Results 1 to 4 of 4
  1. #1
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default Struts validation

    Hi, I can't do the validation !
    can you check my code? I don't know what is the problem.

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

  2. #2
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    8

    Default

    I give you an example, maybe you can resolve it

    About the Struts Declarative Form Validation Example

  3. #3
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    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)

  4. #4
    kzvi.kzvi.1 is offline Member
    Join Date
    Oct 2008
    Location
    US
    Posts
    58
    Rep Power
    0

    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

Similar Threads

  1. form validation
    By abhiN in forum New To Java
    Replies: 0
    Last Post: 03-07-2008, 07:04 AM
  2. Swing Validation
    By ppayal in forum AWT / Swing
    Replies: 0
    Last Post: 02-09-2008, 09:00 AM
  3. Swing validation
    By ppayal in forum New To Java
    Replies: 0
    Last Post: 02-09-2008, 08:59 AM
  4. Another Query On Validation
    By Albert in forum Web Frameworks
    Replies: 1
    Last Post: 07-05-2007, 06:47 PM
  5. javascript validation
    By yuchuang in forum New To Java
    Replies: 5
    Last Post: 05-14-2007, 03:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •