Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-14-2007, 05:39 PM
Senior Member
 
Join Date: Jun 2007
Posts: 130
Rep Power: 0
Jack is on a distinguished road
Default Struts validation
Hi, I can't do the validation !
can you check my code? I don't know what is the problem.

Code:
 SolForm (extends ValidatorForm), in the struts-config 

<form-bean name="SolForm " type="users.actions.forms.SolValidateForm"></form-bean> 


<action path="/Sol" type="users.actions.solAction" unknown="false" validate="true"> <forward name="no" path="solPage" redirect="false"></forward> 


<action path="/getForm" type="users.actions.sol.SolGetAction" name="SolForm" scope="request" unknown="false" validate="true"> <forward name="OK" path="ResultPage" redirect="false"></forward>
in the validation.xml I have
Code:
field property="DATE" depends="required,date"> 
msg name="required,date" key="fail.DATE"></msg> 
arg0 key="SolForm .DATE"></arg0> 
/field> 
field property="Subject" depends="required"> 
msg name="required" key="fail.Subject"></msg> 
arg0 key="SolForm .Subject"></arg0></field> 
field property="person" depends="required"> 
msg name="required" key="fail.tut"></msg> 
arg0 key="SolForm .person"></arg0></field>
In the jsp I have this:
Code:
<html:form action="getForm.do" method="POST"> 
SUBJECT<html:text property="SUBJECT"></html:text><html:errors property="SUBJECT"></html:errors> 
REVISION DATE<html:text property="REVISION DATE"></html:text><html:errors property=" DATESESSION "></html:errors> 
PERSON<html:select property="PERSON"> 
<html:options collection="lPERSON" roperty="ID" abelProperty="Name""></html:options></html:select><html:errors property="PERSON"></html:errors> 
<html:submit>accept</html:submit> 
</html:form>
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-04-2007, 04:38 AM
Senior Member
 
Join Date: Jun 2007
Posts: 164
Rep Power: 3
Heather is on a distinguished road
Default
I give you an example, maybe you can resolve it

About the Struts Declarative Form Validation Example
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-04-2007, 04:41 AM
Senior Member
 
Join Date: Jun 2007
Posts: 119
Rep Power: 0
Peter is on a distinguished road
Default
I didn't find your error
Can you paste more code?
anyway i give you this link,
check it out
Struts Tutorial: Struts Validation (Client and Server Side)
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-06-2008, 01:54 AM
Member
 
Join Date: Oct 2008
Location: US
Posts: 58
Rep Power: 0
kzvi.kzvi.1 is on a distinguished road
Default
Is this struts2 or struts1? If its about struts 2 then Here is an Example Code which demonstrate how you can use regular expression validation for number validation in Struts 2.

____________________________________________
Software Wiki | Interview FAQs | Lucene Search | Oracle | ORM | Struts2 | Job Seeker
__________________
Have fun....
JAVA FAQs
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
form validation abhiN New To Java 0 03-07-2008 08:04 AM
Swing Validation ppayal AWT / Swing 0 02-09-2008 10:00 AM
Swing validation ppayal New To Java 0 02-09-2008 09:59 AM
Another Query On Validation Albert Web Frameworks 1 07-05-2007 07:47 PM
javascript validation yuchuang New To Java 5 05-14-2007 04:38 PM


All times are GMT +2. The time now is 11:59 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org