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.
Thanks in advance,
Anna.
On Thursday 19 February 2004 04:18 pm, Anna Bikkina wrote:
> That worked like a dream.
> Thank you
>
> Anna.
>
> On Thursday 19 February 2004 03:35 pm, [EMAIL PROTECTED] wrote:
> > Hi Anna,
> >
> > The spaces may be appearing because you have put spaces and newlines in
> > the following:
> >
> > <input name="enddate" type="text" >
> > <xsp:attribute name="value">
> > <xsp-request:get-parameter name="enddate" default=""/>
> > </xsp:attribute>
> > </input>
> >
> > To eliminate them, try reformatting and condensing what you have to:
> >
> > <input name="enddate" type="text" >
> > <xsp:attribute name="value"><xsp-request:get-parameter name="enddate"
> > default=""/></xsp:attribute>
> > </input>
> >
> > Not 100% sure it'll fix your problem, but I've often has spaces crop up
> > when trying to adhere to a "nice" format, and they usually disappear when
> > I condense the XML.
> >
> > HTH!
> >
> > Thanks!
> > David Day
> >
> >
> >
> >
> > Anna Bikkina <[EMAIL PROTECTED]>
> >
> >
> >
> >
> > 02/19/2004 03:26 PM
> > Please respond to users
> >
> >
> > T
> > To: [EMAIL PROTECTED]
> > cc:
> >
> > bcc:
> > Subject: Re: XSP Validation XSP-formval
> >
> >
> > Never mind that worked. I am now able to validate my form. The problem is
> > with
> > sitemap . The descriptor file could not be located. When I changed the
> > path
> > it worked.
> >
> > One other question. To refill the values in the form when there is some
> > problem in the input. I am using the tags
> > <input name="enddate" type="text" >
> > <xsp:attribute name="value">
> > <xsp-request:get-parameter name="enddate" default=""/>
> > </xsp:attribute>
> > </input>
> >
> > Everytime I click submit and the same page is reloaded due to some errors
> > I
> > see a couple of spaces added to the input text value at the beginning.
> > The
> >
> > length of the text value is increasing. Did anyone see similar problem.
> > Any
> > help will be appreciated. How can I get rid of the spaces in front of my
> > input text which are being created when I click on submit.
> >
> > Thanks in advance,
> > Anna.
> >
> > On Thursday 19 February 2004 02:50 pm, Anna Bikkina wrote:
> > > Hi,
> > >
> > > I am using xsp-formval to validate data in my xsp forms. Somehow I am
> >
> > not
> >
> > > able to validate the form . My XSP form has the following lines
> > >
> > > <xsp-formval:descriptor
> > > name="/usr/local/jboss/tomcat/webapps/cocoon/myserver/
> > > styles/descriptor.xml" constraint-set="securityquote">
> > > <paragraph>
> > > <xsp-formval:results/>
> > > </paragraph>
> > >
> > > and so on...
> > >
> > > I have my descriptor file in the same location. Here is my descriptor
> >
> > file.
> >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <root>
> > >
> > > <parameter name="security" type="string" min-len="2" max-len="15"
> > > nullable="no"/>
> > > <parameter name="startdate" type="string" nullable="no" min-len="6"
> > > max-len="10"/>
> > > <parameter name="enddate" type="string" nullable="no" min-len="6"
> > > max-len="10"/>
> > >
> > > <constraint-set name="securityquote">
> > > <validate name="security"/>
> > > <validate name="startdate"/>
> > > <validate name="enddate"/>
> > > </constraint-set>
> > >
> > > </root>
> > >
> > >
> > > For some reason no valdiation is being done. I am checking not null
> >
> > fields
> >
> > > and even when I give all non null fields its not raising an error. Is
> >
> > there
> >
> > > something that I am missing here. Please comment.
> > >
> > > Thanks in advance,
> > > Anna.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]