cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Timberlake <and...@timberlake.co.za>
Subject Re: xsp-element equivalent to xsl:param?
Date Fri, 31 Jan 2003 12:39:09 GMT
On Fri, 2003-01-31 at 14:31, Scherler, Thorsten wrote:
> Hello group,
> 
> is there an equivalent in xsp to the xsl: <xsl:param name="date"/>?
Yes, see below

> 
> e.g. guess my request is like that: ...?date=30%2F01%2F2003.
> 
> And 
> <esql:query>
>          select * from info_bericht  where Info_datum = #<xsp-request:get-parameter
name="date"/>#
>  </esql:query>
> is working fine.
> 
> But <xsp-request:get-parameter name="date"/> can't be used in <xsp:logic/>
like that:
> 	<xsp:logic>
>     String timeOfDay = (
>       new SimpleDateFormat("MM/dd/yyyy")
>     ).format(<xsp-request:get-parameter name="date"/>);
>   </xsp:logic>

<xsp:logic>
try{
    String timeOfDay = (new
SimpleDateFormat("MM/dd/yyyy")).format(parameters.getParameter("date");
}catch(Exception e){}
</xsp:logic>

You will need to wrap the code in a try/catch block or alternatively use
the syntax: parameters.getParameter("date", "default value of choice");

> 
> If I do that I get:
> type fatal
> message Language Exception
> description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException:
Error while instantiating org\apache\cocoon\www\logic\IDC2_info_int_xsp: java.lang.NullPointerException
> 
> King regards for any help!
> 
> > Mit freundlichem Gruss,
> > 
> > Thorsten Scherler
> > Marketing / Telefonmarketing
> > 
> > Weidmüller GmbH & Co.
> > P.O. Box 2807
> > 33058 Paderborn
> > Tel.:+ 49 - 5252-960-350
> > Fax:+ 49 - 5252-960-116
> > eMail: thorsten.scherler@weidmueller.de
> > http://www.weidmueller.de
> > 
> > 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
-- 
Andrew Timberlake <andrew@timberlake.co.za>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message