File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts error message display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts error message display" Watch "Struts error message display" New topic
Author

Struts error message display

Ritu varada
Ranch Hand

Joined: Sep 08, 2004
Posts: 117
Here's the thing. I have a input.jsp which just has a text field. I have written the form file for this with the usual getters and setters. The problem I am having is that the error message ( that the id is missing )appears when I load the page itself. I am not able to make it appear once the submit button is clicked. I am not sure what I am doing wrong. Any help would be appreciated. Thanks.


SCJP,SCWCD(1.4)
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi ritu

One thing how are u loading that page ?? is it thorugh some action class .if so make sure that that action should not have any form bean associated with it and even if it has u should bypass the validations .........that might be one reason why it might be happening

if its directly loading a jsp i dont think so it will happen
Ritu varada
Ranch Hand

Joined: Sep 08, 2004
Posts: 117
You are right, Sreenath. The jsp does point to a action class which is associated with a form bean and hence the validation shows up. I want the jsp to be associated with the form bean. Then, how do I make the validation come up only when the submit is clicked ? How do I bypass the validation when the page is initially loaded ? Thanks for your help.
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi ritu

Its just simple ,defaultly validate will be true so just set the validate="false" while loading that page and ofcourse on clicking submit that action should have validate="true" which will validate only on submit if u still have any issue u can mail me at sreenathn@huawei.com
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts error message display
 
Similar Threads
error while opening mock exam
OO basics doubt
JAXB 2.1 Unmarshaller error
Unable to open the roundsup test of javaranch
dialog box with final info in it