cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bert Van Kets <b...@vankets.com>
Subject Re: xsp request variable is not declaired
Date Mon, 28 Oct 2002 22:15:48 GMT
Make sure you put your request inside a tag.  Like this:
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp" 
xmlns:esql="http://apache.org/cocoon/SQL/v2" 
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
   <data>
     <xsp:logic>
                 your logic
         </xsp:logic>
   </data>
</xsp:page>

As you can see, I'm using the xsp-request logic sheet.  Should be the same 
though.

Bert


At 14:46 28/10/2002 -0600, you wrote:
>Hi Everyone-
>
>Here is a newbe question:  I'm trying to use the implicit 'request' 
>variable in a xsp page, however, whenever I try to access it like this I 
>get a NPE error at line x:
>
><xsp:logic>
>         keyword = request.getParameter("value");        //line x
></xsp:logic>
>
>When I attempt to access it like this, I get an "illegal start of type" 
>error at line x:
>
><xsp:logic>
>   String comment = "";
>
>   if (request == null) {                //line x
>         comment = "Request is null";
>   } else {
>         comment = "Request is NOT null";
>   }
></xsp:logic>
>
>This seems to point to 'request' as not having been declared, doesn't 
>it?  Doing something like this works:
>
><xsp:logic>
>   String keyword = "C";
></xsp:logic>
><content>
><esql:connection>
>   <esql:pool>cocoon</esql:pool>
>   <esql:execute-query>
>   <!-- <xsp-request:get-parameter name="value"/> -->
>    <esql:query>select * from Resources where ResourceName like 
> '%<xsp:expr>keyword</xsp:expr>%'</esql:query>
>    <esql:results>
><esql:row-results>
><row>
><esql:get-columns/></row>
></esql:row-results>
>    </esql:results>
>   </esql:execute-query>
></esql:connection>
>
></content>
>
>
>Any ideas?  This is driving me up the wall.  I would post more of the 
>error code, config, etc, but it seems like this must be something major 
>and (hopefully) obvious.
>
>Thanks,
>
>Eric Everman
>
>
>
>---------------------------------------------------------------------
>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>


Mime
View raw message