This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
 
Consider Paul's rocket mass heater.
 
subject: Struts error message display