| 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
|
 |
 |
|
|
subject: Struts2 Validation not displaying messages?
|
|
|