Derek,

Try
        if (handler.length() > 0)

John

Derek Harmel wrote:
> Forgive me as I fairly new to Cocoon and have virtually no experience
> with Java.  Don't worry, I'm not going to ask you to write something
> for me.
> 
> Anyway, I have a problem with an XSP that I just cannot figure out. 
> In the code below, if I do not comment out the two 'if statements' and
> the 'else statement', I get a Null Pointer Exception.  However, when I
> do comment those lines out, it seems to compile just fine.  Does
> anyone see what my problem is?
> 
> If "handler" and "repeat" do not exist in the request parameters and
> attributes respectively, could this be causing the problem?
> 
> The exception happens in "ServerPagesGenerator.generate()".  Cocoon v2.1.8.
> 
> Thanks in advance.
> 
> <?xml version="1.0"?>
> 
> <xsp:page
>     language="java"
>     xmlns:xsp="http://apache.org/xsp";
>     xmlns:xsp-request=" http://apache.org/xsp/request/2.0";
>     xmlns:action="http://apache.org/cocoon/action/1.0";
> 
>     <check>
>         <xsp:logic>
>             String handler = (String)request.getParameter( "handler" );
>             String repeat  = (String)request.getAttribute( "repeat" );
> 
>             if( handler.length() > 0 )
>             {
>                 if( repeat.length() == 0 || repeat.equals("0") )
>                 {
>                     <action:set-result>
>                         <action:param name="name">handler</action:param>
>                         <action:param
> name="value"><xsp:expr>handler</xsp:expr></action:param>
>                     </action:set-result>
>                     <action:set-success />
>                     <xsp-request:set-attribute
> name="repeat">1</xsp-request:set-attribute>
>                     <handler><xsp:expr>handler</xsp:expr></handler>
>                 }
>             }
>             else
>             {
>                 <action:set-failure />
>                 <xsp-request:set-attribute
> name="repeat">0</xsp-request:set-attribute>
>             }
>         </xsp:logic>
>     </check>
> </xsp:page>


-- 
---------------------------------------------------------
 Jentro Technologies GmbH
 John L. Webber, Software Development
---------------------------------------------------------
 Rosenheimer Str. 145e      81671 München
 Tel. +49 89 189 169 80     mailto:[EMAIL PROTECTED]
 Fax  +49 89 189 169 99     http://www.jentro.com
---------------------------------------------------------
NOTICE: The information contained in this e-mail is confidential or may
otherwise be legally privileged. It is intended for the named recipient
only. If you have received it in error, please notify us immediately by
reply or by calling the telephone number above and delete this message
and all its attachments without any use or further distribution of its
contents. Please note that any unauthorised review, copying, disclosing
or otherwise making use of the information is strictly prohibited. Thank
you.
---------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to