This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts2 Validation not displaying messages? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 Validation not displaying messages? " Watch "Struts2 Validation not displaying messages? " New topic
Author

Struts2 Validation not displaying messages?

Anuradha Prasanna
Ranch Hand

Joined: Mar 09, 2006
Posts: 115
Here is my code for a validating the username/password in login page using struts 2's "requiredstring" validator

Login.java -> Action class



struts.xml


login.jsp


Login-validation.xml


Login.properties
# To change this template, choose Tools | Templates
# and open the template in the editor.
password.required = Password is required.
username.required= Username is required.

Success.jsp


Login.java, Login-validation.xml, Login.properties are all in the same folder "example.mine".

Also i get this in my tomcat console,
Feb 11, 2013 11:07:56 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Parameter [password] is not on the excludeParams list of patterns and will be appended to action!
Feb 11, 2013 11:07:56 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Parameter [userName] is not on the excludeParams list of patterns and will be appended to action!


If i don't give the password or username or both, i get the login page again without the message.
PLEASE help me find out why i am not getting the messages?



SCJP 6.0 90%
Ankit Dan
Ranch Hand

Joined: Aug 31, 2012
Posts: 47

well instead of simple HTML tags try to use struts tag, for textbox and submit minimal difference in their attributes
like
or

Check out this link
Struts 2 Tags

hope this helps
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts2 Validation not displaying messages?
 
Similar Threads
validation in struts2
validation using Resource Bundle
Form Validation using action-validation.xml file
Form Validation using xml in struts2
problem in struts2 validation