• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 Validation..Need Help

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

I am having hard time making Struts2 Validation Framework work in my scenario. Please help me solving the problem.

My Scenario:

1] My ActionClass implement ModelView Interface. It has three methods to add, delete and update. Consider I have three JSPS, add.jsp, update,jsp, delete.jsp
2] I need validation in update.jsp, add.jsp which has different UI so created a validation file ActionClass-update-validations.xml and ActionClass-add-validations.xml respectively.
3] My struts.xml has one action tag with 3 different result as seen below

<action name="myaction_*" method="{1}" class="MyAction">
<interceptor-ref name="defaultStack"/>

<result name="input">jsps/edit.jsp</result>
<result name="list">jsps/add.jsp</result>
<result name="list">jsps/list.jsp</result>
<result name="edit">jsps/edit.jsp</result>
</action>

For validation i have to supply result="input" jsps which will display error messages. I have validation in 3 jsps. How can I provide 3 different "input" jsps each for add.jsp, edit.jsp etc ? Also how to maintain the request values on JSP if validation fails.

Also How to use annotations in this scenario










 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic