File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes  <s:fielderror/> is not display error mybrowser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " <s:fielderror/> is not display error mybrowser" Watch " <s:fielderror/> is not display error mybrowser" New topic
Author

<s:fielderror/> is not display error mybrowser

Piraba Sivakadadcham
Greenhorn

Joined: Nov 07, 2008
Posts: 6
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

<s:fielderror/>
<s:actionmessage/>
<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

S.Piraba


[Thumbnail for error.JPG]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: <s:fielderror/> is not display error mybrowser