You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kaushal, Anubhav" <An...@deshaw.com> on 2007/03/19 19:35:49 UTC
Using Struts Validator framework
I am using Struts Validator framework and DynaActionForm for performing
form data validations. The user input is taken and then corresponding
record is fetched from the database. Depending on the query result, I
need to display appropriate message to the user. How can I achieve this?
It will be of great help if you can provide me some related sample code.
Thanks in advance for your help.
Anubhav.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: url validation
Posted by Joe Yuen <jo...@chisq.com>.
I am trying to validate a url. I have the following in my validation.xml file
<form name="LinksInputForm" >
<field property="url1" depends ="url" >
<arg0 key="label.url" />
<var>
<var-name>allowallschemes </var-name>
<var-value>true</var-value>
</var>
<var>
<var-name>allow2slashes </var-name>
<var-value>true</var-value>
</var>
<var>
<var-name>schemes</var-name>
<var-value>http,https,telnet,file</var-value>
</var>
<var>
<var-name>nofragments</var-name>
<var-value>true</var-value>
</var>
</field>
</form>
However when I use a url like http://www.apple.com, it fails. What am I doing wrong?
Thanks,
-Joe
Re: Using Struts Validator framework
Posted by Dave Newton <ne...@yahoo.com>.
--- "Kaushal, Anubhav" wrote:
> The user input is taken and then corresponding
> record is fetched from the database. Depending on
> the query result, I need to display appropriate
> message to the user. How can I achieve this?
It's not clear to me what this has to do with the
Validator framework, which is primarily for validating
forms.
If you want to display an error message using the
Struts errors or messages tags if, say, the record is
not found, you can use the Action class's addErrors or
addMessages methods.
d.
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org