cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sonny Sukumar <ssuku...@EcologyFund.net>
Subject Re: Possible with XSPs?
Date Mon, 14 Oct 2002 03:57:08 GMT

Hi,

I included the xsp-request namespace in my XSP and then put in the code:

<xsp:logic>
 String productId = <xsp-request:get-parameter name="productid"/>;
</xsp:logic>

This code is right above my root document element.  I get this error when I try running it
by going to http://localhost:8080/cocoon/test?productid=12345678:

org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException:
Error while instantiating org/apache/cocoon/www/products_xsp: java.lang.NullPointerException

The product with productid 12345678 exists in my backend database and the code works fine
when I hardcode the value into my XSP, rather than trying to get it as a parameter.

Any idea what I'm doing wrong?

Thanks again,

Sonny

--- Antonio Gallardo Rivera <agallardo@agsoftware.dnsalias.com> wrote:
>El Domingo, 13 de Octubre de 2002 17:26, Sonny Sukumar escribi=F3:
>> Hi guys,
>>
>> Is it possible to access request parameters from within an XSP or
>> logicsheet?
>
>Yes, you can, for more info:=20
>http://xml.apache.org/cocoon/userdocs/xsp/request.html
>
>>
>> For example, when I go to http://localhost:8080/cocoon/test?param=3D12345=
>678
>> I'd like to use the value of param in my XSP or logicsheet as a basis for
>> calling Java functions.
>
>You can do it using:
><xsp:logic>
> String sParam =3D <xsp-request:get-parameter name=3D"param" default=3D""/>;
></xsp:logic>
>
>Rememeber to declare your namespace in you XSP:
>xmlns:xsp-request=3D"http://apache.org/xsp/request/2.0"
>
>>
>> In my pipeline, I currently just have the XSP as the generator and 1 XSL
>> stylesheet to output to HTML.  I think I could introduce another XSL
>> stylesheet before this one which has use-request-paramters set to true and
>> get the param that way, but it seems like it'd be slower to do 2 transfor=
>ms
>> with 2 separate stylesheets rather than 1 transform with 1 stylesheet.
>>
>> Thanks!
>>
>> Sonny
>
>Antonio Gallardo
>>
>> _____________________________________________________________
>> Conserve wilderness with a click (free!) and get your own EcologyFund.net
>> email (free!) at http://www.ecologyfund.com.
>>
>> _____________________________________________________________
>> Select your own custom email address for FREE! Get you@yourchoice.com w/No
>> Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=3Dtag
>>
>> ---------------------------------------------------------------------
>> 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>
>
>---------------------------------------------------------------------
>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>

_____________________________________________________________
Conserve wilderness with a click (free!) and get your own EcologyFund.net email (free!) at
http://www.ecologyfund.com.

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP &
more! http://www.everyone.net/selectmail?campaign=tag

---------------------------------------------------------------------
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