Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please HELP html:errors in struts's jsp

 
prasanna pati
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
basically I am doing a struts project and there is a problem about showing the validations and server side errors .

I am making it simple say just a login page with username and password .
Now I can make many validations checks in the form-beans thats fine .
NOW IN JSP PAGE I AM MAKING LIKE >> :roll:
<tr>
<td>user Name::</td>
<td><html:text property="userName" /></td>
</tr>


<tr>
<td>password::</td>
<td><html:text property="password" /></td>
</tr>

<tr>
<td>
<html:errors />
</td>
</tr>




SO THE PROBLEM IS THAT WHATEVER ERROR I AM MAKING THAT IS SHOWING AFTER THE PASSWORD FIELD , i mean where i have wrote the <html:errors />

ok?

now I want to make it error messages for username will appear just after the username and error messages for passwords will appear at the password place .

CAN ANYONE TELL ME HOW TO DO THAT ?

 
purushottaman dwarkanathan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ideally i think that you should have all the server side errors logged on top of the page, instead of showing it below each and every field.

When ever you build up errors using the action messages, you can have tiles configured to include a errorPage to get it invoked.
 
prasanna pati
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know that . if you have a solution to my problem then only answer
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by prasanna pati:
i know that . if you have a solution to my problem then only answer


Come on, prasanna! Being a common forum where in you have stepped in to resolve your issue, do you think is this the way to respond without even thanking atleast for the efforts of person who replied?

How come he will be knowing that you are aware of what he is gonna say? A forum does NOT insist people to reply only when they know the correct answers. A suggestion is half the way to resolve the issues.

I suggest you to please go through this thread first!

I also go with purushottaman dwarkanathan. The usual way of placing the "html:errors" element would be at the top of the page and NOT at the bottom.
[ July 30, 2007: Message edited by: Raghavan Muthu ]
 
Ranjit Gopinathan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too go with what purushottaman dwarkanathan suggested.

To answer your question.

Considering you are using validate method in action form and validation failed for userName.

and in jsp.

In this case, the errors associated with the property specified will be displayed.

Have an entry in properties file for
INVALID_USERNAME


- HTH

Always be nice with ppl trying to help ya ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic