jaggernat
asked on
<html:errors/> not working
dear experts
for some reason , my <html:erors/> is now working .
this is my jsp
<html:form action="/casemngt/SampleTe st.do?meth od=sampleS ave" method="post">
</html:errors>
<TABLE width="725" cellpadding="0" cellspacing="0" border="0">
<Col width="10">
<Col width="150">
<Col width="183">
<Col width="250">
<TR>
<TD></TD>
<TD><div class="LabelField"><bean:m essage key="sampleText.name" /></div> </TD>
<TD><html:text property="sampletest1" size="20" maxlength="10"/></TD>
<TD > </TD>
<TD>
</TD>
</TR>
<br><br><br>
<html:submit styleClass="BUTTON1" property="method"><bean:me ssage key="button.save"/>
</html:form>
2) this is my action mapping
<action path="/casemngt/SampleTest "
name="testForm"
scope="request"
validate="true"
type="com.aoc.ffm.uifsa.ac tions.Samp leAction"
input="samplePage.display"
parameter="method">
<forward name="success" path="samplePage.display" >
</forward>
</action>
3)my form bean
<form-beans>
<form-bean name="testForm" type="org.apache.struts.va lidator.Dy naValidato rForm" dynamic="true">
<form-property name="docAcsesNumber" type="java.lang.String" />
<form-property name="sampletest1" type="java.lang.String" />
</form-bean>
</form-beans>
4)in my web.xml file i have validate=true and i have also imported the plug ins for the validations in struts-config like this
<!-- Plugins-->
<plug-in className="org.apache.stru ts.validat or.Validat orPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator- rules.xml, /WEB-INF/validation.xml" />
</plug-in>
i am clueless why this is not working?
any help appreciated
thanks
J
for some reason , my <html:erors/> is now working .
this is my jsp
<html:form action="/casemngt/SampleTe
</html:errors>
<TABLE width="725" cellpadding="0" cellspacing="0" border="0">
<Col width="10">
<Col width="150">
<Col width="183">
<Col width="250">
<TR>
<TD></TD>
<TD><div class="LabelField"><bean:m
<TD><html:text property="sampletest1" size="20" maxlength="10"/></TD>
<TD > </TD>
<TD>
</TD>
</TR>
<br><br><br>
<html:submit styleClass="BUTTON1" property="method"><bean:me
</html:form>
2) this is my action mapping
<action path="/casemngt/SampleTest
name="testForm"
scope="request"
validate="true"
type="com.aoc.ffm.uifsa.ac
input="samplePage.display"
parameter="method">
<forward name="success" path="samplePage.display" >
</forward>
</action>
3)my form bean
<form-beans>
<form-bean name="testForm" type="org.apache.struts.va
<form-property name="docAcsesNumber" type="java.lang.String" />
<form-property name="sampletest1" type="java.lang.String" />
</form-bean>
</form-beans>
4)in my web.xml file i have validate=true and i have also imported the plug ins for the validations in struts-config like this
<!-- Plugins-->
<plug-in className="org.apache.stru
<set-property property="pathnames" value="/WEB-INF/validator-
</plug-in>
i am clueless why this is not working?
any help appreciated
thanks
J
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you setup the validation in validation.xml?
Feor example:
<formset>
<form name="testForm">
<field property="sampletest1" depends="required">
<arg key="sampleText.name"/>
</field>
</form>
</formset>
Feor example:
<formset>
<form name="testForm">
<field property="sampletest1" depends="required">
<arg key="sampleText.name"/>
</field>
</form>
</formset>
ASKER
yes i did. every thing is set up but when i click on save its going to the next page without displaying the error message when the field is blank
ASKER
ok guys , i am facing an absolutely goofy situation. my <html:errors/> messages sometimes work and sometimes do not work..i.e i am able to see error messages when i run my application ,but i dont make any changes and then i run my application again and i dont see the error messages.
do i have to download/get the latest dtd or something.
any advice greatly appreciated
thanks
J
do i have to download/get the latest dtd or something.
any advice greatly appreciated
thanks
J
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i know what exactly the problem is.
when ther are no errors in the page, it goes to the action class.
when ther are errors in page, it does not go to the action class ,but at the same time it does not show me any error messages BECAUSE my "validation.xml" file is NOT getting detected by struts framwork.
Any help to resolve this problem would be greatly appreciated
thanks
J
when ther are no errors in the page, it goes to the action class.
when ther are errors in page, it does not go to the action class ,but at the same time it does not show me any error messages BECAUSE my "validation.xml" file is NOT getting detected by struts framwork.
Any help to resolve this problem would be greatly appreciated
thanks
J
Sorry,
Can't really help you here as I am not really good in validation of Struts.
David
Can't really help you here as I am not really good in validation of Struts.
David
ASKER
fixed
> when ther are no errors in the page, it goes to the action class.
> when ther are errors in page, it does not go to the action class
This is the behaviour of struts. Struts will perform validation using validation.xml, if error occured it forward to the 'input' configured in the action. if no error then it will execute the action class.
> BECAUSE my "validation.xml" file is NOT getting detected by struts framwork.
If strust not detected the validation.xml, you will get error when server startup.
> when ther are errors in page, it does not go to the action class
This is the behaviour of struts. Struts will perform validation using validation.xml, if error occured it forward to the 'input' configured in the action. if no error then it will execute the action class.
> BECAUSE my "validation.xml" file is NOT getting detected by struts framwork.
If strust not detected the validation.xml, you will get error when server startup.
ASKER
>>>>This is the behaviour of struts
yes ,agree
>>>>BECAUSE my "validation.xml" file is NOT getting detected by struts framwork
I was wrong. validation.xml was getting detected but there was some problem with application resources file.
I wanted to split points and give it to you and suprapto (250 each).But by mistake , i assigned points to suprapto twice.
i dont know if this can be corrected by the EE admin or something
thanks
J
yes ,agree
>>>>BECAUSE my "validation.xml" file is NOT getting detected by struts framwork
I was wrong. validation.xml was getting detected but there was some problem with application resources file.
I wanted to split points and give it to you and suprapto (250 each).But by mistake , i assigned points to suprapto twice.
i dont know if this can be corrected by the EE admin or something
thanks
J
Hi J,
>>"I wanted to split points and give it to you and suprapto (250 each)."
Yes you can. Ask it to admin to re-open the question. Let me know if you have problems.
>>"I wanted to split points and give it to you and suprapto (250 each)."
Yes you can. Ask it to admin to re-open the question. Let me know if you have problems.
ASKER