• 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

Struts 2 + hibernate + validation

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am currently doing the tutorial CRUD example http://www.vaannila.com/struts-2/struts-2-example/struts-2-crud-example-1.html , this is integrating STRUTS2+HIBERNATE
In this tutorial , in struts.xml
In struts we can do validation in xml as shown in this tutorial http://www.vaannila.com/struts-2/struts-2-example/struts-2-validation-using-xml-example-1.html , for struts validation , in struts.xml
We can do Hibernate Validation as shown in this tutorial http://www.vaannila.com/struts-2/struts-2-tutorial/struts-2-hibernate-validation-tutorial-1.html

So my question is this
1. In CRUD example http://www.vaannila.com/struts-2/struts-2-example/struts-2-crud-example-1.html ,
I want to add struts validation as shown in http://www.vaannila.com/struts-2/struts-2-example/struts-2-validation-using-xml-example-1.html
Is this possible in struts.xml,

I have tried it,it is not working.

2. What is the best way to include struts-validation in the CRUD example


Thanks in advance,
Vanlal >
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Struts Documentation says that the package element's extends attribute can contain "one or more previous packages", though I would put money on the hibernate-default package already extending struts-default. If I could find it. I downloaded the tutorial source and no luck.
Did you notice you have a double-quote out of place in your declaration?
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Did you notice you have a double-quote out of place in your declaration?


Copy and paste error ...
Well got the answer for this .. we have to do it through hibernate ... we have to do this through interceptors ..
 
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use hibernate 3 and struts 2. I use struts2-fullhibernatecore-plugin.

My struts.xml is simple:

My entity is also simple:

Next is my action class that uses @javax.validation.VAlid annotation to trigger hibernate constraints.

Can you tell what interceptors I am missing ?

Thank you!
 
reply
    Bookmark Topic Watch Topic
  • New Topic