cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger I Martin PhD" <hypernex...@hypernexinc.com>
Subject Re: xsp-request problem
Date Mon, 04 Mar 2002 16:15:22 GMT
Hello, I'm using cvs( March 02, 2002) and having success with:

   <xsp:logic>
        String fruit = <xsp:expr><xsp-request:get-parameter
name="fruit"></xsp-request:get-parameter></xsp:expr>;
    </xsp:logic>

generated java code is:
          String fruit =
            ((XSPRequestHelper.getParameter(objectModel, "fruit",
                                            null, null, null)));

but when I try to use

   <xsp:logic>
        String fruit = <xsp:expr><xsp-request:get-parameter
><name>fruit</name></xsp-request:get-parameter></xsp:expr>;
    </xsp:logic>

generated java code is:
           String fruit=((XSPRequestHelper.getParameter(objectModel,
                                            null, null, null, null)));

there is no effect from the child element <name> so the parameter is not
found and the fruit string becomes null (Tried using <xsp:attribute> to set
it as an attribute but got null as well).
I'm doing this for the purpose of placing a variable holding the name of the
parameter into the request like:

   <xsp:logic>
String parameterName="fruit";
        String fruit = <xsp:expr><xsp-request:get-parameter
><name><xsp:expr>parameterName</xsp:expr></name></xsp-request:get-parameter>
</xsp:expr>;
    </xsp:logic>


Regards,

Roger

----- Original Message -----
From: "Istvan Beszteri" <istvan.beszteri@hut.fi>
To: <cocoon-users@xml.apache.org>
Sent: Monday, March 04, 2002 10:34 AM
Subject: xsp-request problem


> Hi All,
>
> I just started to learn XSP and I tried some examples.
> I have found a strange problem with xsp-request.
>
> The following xsp works properly:
>
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?>
> <xsp:page
>     xmlns:xsp="http://apache.org/xsp"
>     xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> >
>     <xsp:logic>
>         String fruit = "apple";
>     </xsp:logic>
>
>     <html>
>        <b>The string is: </b><xsp:expr>fruit</xsp:expr>
>        <br/>
>        <b>The request parameter is: </b> <xsp-request:get-parameter
> name="fruit"/>
>     </html>
> </xsp:page>
>
> with a certain request, but if I try to give value to the fruit string as
in
> the following example, I get a null pointer exception:
>
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?>
> <xsp:page
>     xmlns:xsp="http://apache.org/xsp"
>     xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> >
>     <xsp:logic>
>         String fruit = <xsp-request:get-parameter name="fruit"/>;
>     </xsp:logic>
>
>     <html>
>        <b>The string is: </b><xsp:expr>fruit</xsp:expr>
>        <br/>
>        <b>The request parameter is: </b> <xsp-request:get-parameter
> name="fruit"/>
>     </html>
> </xsp:page>
>
> It seems <xsp-request:get-parameter name="fruit"/> gives back a null
pointer
> if I use it within the <xsp:logic> tags.
>
> Any idea?
>
> Thanks in advance!
>
> Istvan
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.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/faqs.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