• 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

Struts2 Validation not displaying messages?

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?


 
Ranch Hand
Posts: 47
MyEclipse IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic