Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to validate content in dynamically generated textfields?

 
abi chitnis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am dynamically genearting textfields on jsp. How do I validate content of those textfields in acton bean? Following is my jsp.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what kind of validation you need to do.

For "requiredstring" type validation just iterate over the map entries and make sure there's a value.
 
abi chitnis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Initially I juat want a simple validation. So when user clicks on serach button with out entering anything on the page then I will go back to same page with message displayed at the top. But some how it is not working for me. Following is the flow.
display.action - display.jsp (displays dynamic text boxes and dropdowns)

when user clicks on serach button - showquery.action





 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"But some how it is not working for me" is not a helpful diagnostic.

http://faq.javaranch.com/java/TellTheDetails

You may want to reduce the amount of code you post, showing only the necessary details. You have a *lot* of code in your action methods and it's difficult to know what to look at.
 
abi chitnis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to presrve actionErrors and actionMessages across resulttype redirect. I was able to fix that using MessageStoreInterceptor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic