Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts error message display

 
Ritu varada
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic