Solved

<html:errors/> not working

Posted on 2006-06-15
12
360 Views
Last Modified: 2013-11-18
dear experts

for some reason , my <html:erors/> is now working .

this is  my jsp
<html:form  action="/casemngt/SampleTest.do?method=sampleSave" 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:message 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:message 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.actions.SampleAction"
         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.validator.DynaValidatorForm" 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.struts.validator.ValidatorPlugIn">
            <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
0
Comment
Question by:jaggernat
  • 6
  • 4
  • 2
12 Comments
 
LVL 16

Assisted Solution

by:suprapto45
suprapto45 earned 500 total points
ID: 16917443
Is it because of typo?

</html:errors> should be <html:errors />

David
0
 
LVL 10

Author Comment

by:jaggernat
ID: 16919686
sorry , it is <html:errors />
0
 
LVL 14

Expert Comment

by:boonleng
ID: 16925076
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>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Author Comment

by:jaggernat
ID: 16925626
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

0
 
LVL 10

Author Comment

by:jaggernat
ID: 16928223
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
0
 
LVL 16

Accepted Solution

by:
suprapto45 earned 500 total points
ID: 16928730
Hi,

That is weird. Can you explain us in more depth on the situation that the error messages are not displayed properly?

David
0
 
LVL 10

Author Comment

by:jaggernat
ID: 16930331
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
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16939177
Sorry,

Can't really help you here as I am not really good in validation of Struts.

David
0
 
LVL 10

Author Comment

by:jaggernat
ID: 16941709
fixed
0
 
LVL 14

Expert Comment

by:boonleng
ID: 16941790
> 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.
0
 
LVL 10

Author Comment

by:jaggernat
ID: 16944548
>>>>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
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16948173
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.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Reading data  from excel sheet and displaying 1 92
I get error: useBean: Duplicate bean name: {0} 1 161
spring maven example issues 3 41
junit example issue 2 26
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question