Thank you. I tried doing that and now I get the following error
org.apache.cocoon.ProcessingException: action logicsheet cannot be used in
generators
I used action in my xsp file and my sitemap uses generate for the xsp. Is
there a way I can get around this.
my site map
<map:match pattern="security.xsp">
<map:act type="validator">
<map:parameter name="descriptor"
value="/usr/local/jboss/tomcat/webapps/
cocoon/server/styles/descriptor.xml"/>
<map:parameter name="validate-set" value="securityquote"/>
<map:act type="xsp-action">
<map:generate type="serverpages" src="securityresult.xsp"/>
<map:transform src="search.xsl"/>
<map:transform src="context:/historyserver/styles/
dynamic-page2html.xsl">
<map:parameter name="servletPath"
value="{request:servletPath}"/>
<map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
<map:parameter name="contextPath"
value="{request:contextPath}"/>
<map:parameter name="file" value="{0}.xsp"/>
<map:parameter name="remove" value="{0}"/>
</map:transform>
<map:serialize/>
</map:act>
</map:act>
<map:generate src="security.xsp" type="serverpages"/>
<map:transform src="search.xsl"/>
<map:transform src="context:/historyserver/styles/dynamic-page2html.xsl">
<map:parameter name="servletPath" value="{request:servletPath}"/>
<map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
<map:parameter name="contextPath" value="{request:contextPath}"/>
<map:parameter name="file" value="{0}.xsp"/>
<map:parameter name="remove" value="{0}"/>
</map:transform>
<map:serialize/>
</map:match>
my xsp:logic tag below
<xsp:logic>
if(notnew) {
String error = <action:get-result
name="error"/>
if(error!=null) {
<font color = "red">
error
</font>
}
SimpleDataFormat sdf = new
SimpleDataFormat("mm/dd/yyyy");
try {
System.out.println("entering into not
new");
Date sd = new Date();
Date ed = new Date();
if(request.getParameter("startdate")!=null)
sd =
sdf.parse(request.getParameter("startdate"));
if(sd==null || sd.after(new
Date())) {
<action:set-result>
<action:param
name="error">StartDate not valid</action:param>
</action:set-result>
<action:set-failure/>
}
}
<action:set-success/>
}
catch(Exception e) {
<action:set-failure/>
}
}
</xsp:logic>
When I have my xsp logic code in the xsp its giving a differnt error.
java.lang.RuntimeException: java.lang.RuntimeException: Stylesheet directed
termination: java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: Stylesheet directed termination
Please help me solve this problem. I dont know what I am missing
Thanks,
Anna.
On Friday 20 February 2004 03:01 am, John L. Webber wrote:
> Anna,
>
> You're better off using a DateFormat object to parse the request
> parameter instead of the deprecated new Date(String). Then you can catch
> a ParseException and take action based on this. You can instantiate a
> SimpleDateFormat object using a pattern matching the input you expect.
>
> If the XSP is an action, you can use xsp-action:set-success and
> xsp-action:set-failure to communicate the result to the sitemap.
>
> John
>
> Anna Bikkina wrote:
> >Hi,
> >
> >I have another question using XSP form validation. I used XSP-formval
> > using the descriptor file and it worked.
> > Now there are some other validations that I have to do and display errors
> >other than what I can do with the descriptor file. Like I have to check
> > the startdate and enddate entered by user and display error if startdate
> > is after the enddate and things like that. I created a xsp logic tag and
> > did the necessary validations but I am getting error while running the
> > xsp file
> >
> >error is :
> >org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> >java.lang.RuntimeException: org.apache.cocoon.ProcessingException:
> > Exception in ServerPagesGenerator.generate():
> > java.lang.IllegalArgumentException
> >
> >
> >the xsp:logic paragraph that I add looks like this
> ><xsp:logic>
> > if(notnew) {
> > System.out.println("entering into not new");
> > Date sd = new
> > Date(request.getParameter("startdate"));
> > Date ed = new
> > Date(request.getParameter("enddate"));
> > if(sd==null)
> > sd= new Date();
> > if(ed==null)
> > ed=new Date();
> > if(sd.after(new Date())){
> > System.out.println("Start date
> > is greater than today");
> > <font color="red">
> > <xsp:text>* Startdate invalid.
> > Date greater than today</
> >xsp:text>
> > </font>
> > bad=true;
> > }
> > else if(ed.after(new Date())){
> > <font color="red">
> > <xsp:text>* Enddate invalid.
> > Date greater than
> > today</xsp:text> </font>
> > bad=true;
> >
> > }
> > }
> > </xsp:logic>
> >
> >Is there a way I can check errors in the input other than the
> > formvalidation method. I understand that I can write multiple action
> > classes for each of the error I can represent but from there how can I
> > come back to the same file with the error messages.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]