Update!

I guess this problem was due to my lack of knowledge on Java
programming.  So I guess I learned something today: Casting null to
String in Java still results in a null.  A real forehead-smacker. 
Thanks for the help anyway guys.

Here is the working code:


<?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 != null )
           {
               if( repeat != null || repeat.equals("0") ) //yay for
short-circuit
               {
                   <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>


--
Derek Harmel
 :: Web Programmer
 :: KCI Technologies


On 2/13/06, Derek Harmel <[EMAIL PROTECTED]> wrote:
> Ralph,
>
> I was using that method you described before and it was causing me
> problems somewhere, hence why I used the Java method.  Anyway, I did
> change it as you suggested and still got the same exception.
>
> Could this have anything to do with me using JDK 1.5?
>
> --
> Derek Harmel
>  :: Web Programmer
>  :: KCI Technologies
>
> On 2/13/06, Ralph Skulborstad <[EMAIL PROTECTED]> wrote:
>
> > Hi Derek.
> > In just a few applications (yet) I have used Cocoon, and those times I
> > have by some reason ( probably the first way it worked ) used the
> > following syntax when getting request information:
> >
> > String param = <xsp-request:get-parameter name="param1"/>;
> > String attrib = <xsp-request:get-attribute name="attrib1"/>;
> >
> > This is probably just one way of doing things,  and I'm not even sure
> > that it's your problem, but you could try .This one I know works. More
> > info about xsp-request logicsheet :
> >
> > http://cocoon.apache.org/2.1/userdocs/logicsheets/request.html
> >
> > Hope this helps.
> > /Ralph
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

Reply via email to