• 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 Not working

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

I have been trying to have validation inside my application using tutorials from roseindia and java-x.blogspot.com and based on them I have created small sample application but validations are not working. The source codes are below:

index.jsp


struts.xml


LoginAction-validation.xml


LoginAction.java


Application code and flow is working but username and password validation is not working. One thing I got is that if Action name is LoginAction then validation XML file name should be LoginAction-validation.xml which is true in my case. All jars are there in proper place and have rechecked them from given tutorials and samples.

Configuration:
Win XP
JDK 1.6
Apache Tomcat 6.0

Please let me know where Am i making mistake?
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've never seen hibernate-default package before (I need to concentrate on struts more ), but as is given here, the defaultStackHibernate doesn't include Struts validation (instead it uses hibernate validations), so struts validations are not applied to your actions. You'll have to change your showcaseStack and add the validation interceptor to it...
 
Vikash Ananda
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ankit,

Thanks for the info. I removed this line and things worked fine.

<default-interceptor-ref name="showcaseStack"/>

I was not aware if hibernate interceptor could create problem. Thanks for the link also.

Vikash Anand.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic