Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 Validation not displaying messages?

 
Anuradha Prasanna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?


 
Ankit Dan
Ranch Hand
Posts: 47
Eclipse IDE Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic