• Post Reply Bookmark Topic Watch Topic
  • New Topic

<s:fielderror/> is not display error mybrowser  RSS feed

Piraba Sivakadadcham
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All;

Its my issue:

Validate method not working propely in struts2

Action class validate methos is:
public void validate(){
if(getUser().getUsername().length() == 0){
System.out.println("inside the error username error");
addActionMessage("User Name is required");

if(getUser().getPassword().length() == 0){
addActionMessage("Password is required");

if(getUser().getPassword().length() > 6){
addActionMessage( "Minimum passsword length is 6");

System.out.println("###########" + this.hasActionMessages());

In jsp

<div id="result">Submit form bellow.</div>
<s:form action="accountTypeAction" >

<s:textfield name="user.username" label="Email" required="true" />

<!-- <s:textfield name="confirmEmail" key="label.confirmmail" size="20" /> -->

<s:password name="user.password" label="Password" required="true"/>

<!-- <s:password name="cpassword" key="label.confirmpassword" /> -->

Please anybody help me soon please

[Thumbnail for error.JPG]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!