cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <coc...@leverageweb.com>
Subject Re: xspAction
Date Tue, 06 May 2003 16:02:09 GMT
the statement: if(1=1) tries to assign the integer value 1 to
the integer literal 1, which is mathematically correct but not
a legal statement in java AFAIK, nor is else if(1=2).  I'm not
exactly clear on what your code is trying to do, but surely you
mean to use the == comparison operator, and perhaps mean to have
typed some other variable name?

There should be some statement in the logs I think that would
point to some basic compilation problem when it tried to assemble
your xsp into a compiled java class.

Geoff

At 07:22 AM 5/6/2003, you wrote:
>Hello all
>
>I have a trouble when trying tu use the wiki example of sxp action :
>
>In my main sitemap, i add :
><map:action logger="sitemap.action.xsp-action" name="xsp-action"
>src="org.apache.cocoon.acting.ServerPagesAction"/>
>
>In my sub sitemap, I add :
><map:match pattern="test-xsp-action">
>         <map:act type="xsp-action" src="logique/xsp-action.xsp">
>                 <map:read src="'{mon-resultat-fichier}" 
> mime-type="application/pdf"/>
>         </map:act>
>         <map:generate type="serverpages" src="logique/erreur.xsp"/>
></map:match>
>
>In the logic directory, i add the folowing xsp file :
>
><?xml version="1.0" encoding="iso-8859-1"?>
><xsp:page language="java"
>                 xmlns:xsp="http://apache.org/xsp"
>                 xmlns:action="http://apache.org/cocoon/action/1.0">
>
>         <dummypage>
>                 <xsp:logic>
>                         try
>                                 {
>                                 if(1=1)
>                                         {
>                                         /* With <action:set-result/> we 
> set return values
>                                         ** that can be used in the 
> calling pipeline */
>                                         <action:set-result 
> name="mon-resultat-fichier"
>value="documents/0_cv.pdf"/>
>                                         <action:set-result 
> name="some-other-result" value="5987"/>
>                                         // You can use action:param to 
> set the name and/or the value
>dynamically.
>                                         <action:set-result>
>                                                 <action:param
>name="name"><xsp:expr>getName()</xsp:expr></action:param>
>                                                 <action:param
>name="value"><xsp:expr>getValue()</xsp:expr></action:param>
>                                         </action:set-result>
>                                         }
>                                 else if(1=2)
>                                         {
>                                         <action:set-result 
> name="mon-resultat-fichier"
>value="documents/toto.txt"/>
>                                         }
>                                         else
>                                         {
>                                         throw new Exception() ;
>                                         }
>                                 // With <action:set-success/> we indicate 
> that
>                                 // everything went just fine
>                                 <action:set-success/>
>                                 }
>                         catch(Exception e)
>                                 {
>                                 e.printStackTrace() ;
>                                 // With <action:set-failure/> we indicate 
> that
>                                 // something went wrong and that the 
> action has failed
>                                 <action:set-failure/>
>                                 }
>                 </xsp:logic>
>         </dummypage>
></xsp:page>
>
>
>And when I ask test-xsp-action, i become the folowing error message :
>type fatal
>
>message Language Exception
>
>description org.apache.cocoon.ProcessingException: Language Exception:
>org.apache.cocoon.components.language.LanguageException: Could not load
>class for program
>'org/apache/cocoon/www/file_/users/drsi/guckert/referentiels/essais/logique/xsp_action_xsp'
>due to a java.lang.ClassNotFoundException:
>org.apache.cocoon.www.file_.users.drsi.guckert.referentiels.essais.logique.xsp_action_xsp
>
>sender org.apache.cocoon.servlet.CocoonServlet
>
>source Cocoon servlet
>
>What did i wrong ?
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


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