wood burning stoves 2.0*
The moose likes Struts and the fly likes please HELP    html:errors  in struts's jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "please HELP    html:errors  in struts Watch "please HELP    html:errors  in struts New topic
Author

please HELP html:errors in struts's jsp

prasanna pati
Ranch Hand

Joined: Jan 29, 2005
Posts: 46
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

Joined: Apr 26, 2005
Posts: 25
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.


IBM Certified SOA Associate
prasanna pati
Ranch Hand

Joined: Jan 29, 2005
Posts: 46
i know that . if you have a solution to my problem then only answer
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344


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 ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Ranjit Gopinathan
Ranch Hand

Joined: Jul 03, 2007
Posts: 46
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 ..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please HELP html:errors in struts's jsp
 
Similar Threads
No tag "form" defined in tag library imported with prefix "html"
blank page returned from validate
Problem in SessionManagement in Struts
Struts making me nuts :)
Struts FORM