wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts2 validation using annotaions for Model Driven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 validation using annotaions for Model Driven" Watch "Struts2 validation using annotaions for Model Driven" New topic
Author

Struts2 validation using annotaions for Model Driven

sarada srinivas
Greenhorn

Joined: Oct 09, 2008
Posts: 20
Hi All,

I am trying to validate a username and password in a model by implemented that class in Action as Model Driven.

validation usign annotations are not working???

Can any one please help me??

If I am passing the validation directly under action class everything works fine but i want the validation using ModelDriven.

Thanks in advance
sarada.
sarada srinivas
Greenhorn

Joined: Oct 09, 2008
Posts: 20
Hi all,

I have followed these steps to proceed further but still unsucessfull.

Added init param in web.xml
1) <init-param>
<param-name>actionPackage</param-name>
<param-value>com.vaanila.action</param-value>
</init-param>

2)<s:form action="welcome" validate="true">
<s:fielderror />
<s:textfield name="userName" label="User Name" />
<s:submit />
</s:form>

3) Action class


I am geting the Error but not on the form but on the server console

SEVERE: Validation error for userName:Name required


Can some please findout what I am missing to display the error on the form???
sarada srinivas
Greenhorn

Joined: Oct 09, 2008
Posts: 20
I am still having this issue.

Can anyone help me please....

Thanks,
sarada
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts2 validation using annotaions for Model Driven
 
Similar Threads
Model or bean class is not available to Action Class
MVC and Form Validation
Parameter Interceptor behaviour in case of Model driven Action
Writing an INTERCEPTOR and Configuring it
Validation with Model-Aware design.