I am using xml based validation.

*Problem:*

I don't want validation to perform on input form when page loaded first time
because all the fields are blank for user to fill in. Suppose for register
form to add new student. It should perform once I click the button.

*Note:* /I want to retain same url even when I do the validation on button
click. New form URL is http://localhost:8000/Struts2_Spring_Crud/student/add
and if validation fail even than the url should be same./

*struts.xml*


        <action name="add" class="com.myapp.actions.StudentAction"
method="insertOrUpdateStudent">
            <result name="success" type="redirectAction">list</result>
            <result name="input" type="tiles">/student.edit.tiles</result>
        </action>

*input form*

<s:fielderror/>
    <s:form action="add" method="POST">

        <s:label name="name" value="Name *"/>
        <s:textfield name="student.name" value="%{student.name}"/>
        <s:fielderror fieldName="student.name"/>

        <s:label name="age" value="Age *"/>
        <s:textfield name="student.age" value="%{student.age}"/>

        <s:submit name="saveForm" value="#title"/>
    </s:form>





--
View this message in context: 
http://struts.1045723.n5.nabble.com/struts2-disable-validation-on-page-load-tp5710743.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to