kiran patil

Greenhorn
+ Follow
since Oct 11, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by kiran patil

Hi
why this is not working
Action action=new Action();

action.saveMessages(request,messages);
19 years ago
Hi Everybody
I am working on a struts 1.2.4.
I want to know how we can use ActionMessages and pull them by
<html:messages> tag.
This is what I tried but not working
Following is the code of a validate method of a formbean

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request)
{
ActionMessage msg = null;
ActionErrors errors = new ActionErrors();
ActionMessages messages=new ActionMessages();
if (getLoginID() == null || getLoginID().length() < 1)
{
msg = new ActionMessage("errors.loginID.required");
//errors.add(ActionMessages.GLOBAL_MESSAGE,msg );
messages.add(ActionMessages.GLOBAL_MESSAGE,msg );

}
if (getPassword() == null || getPassword().length() < 1)
{
msg = new ActionMessage("errors.password.required");
// errors.add(ActionMessages.GLOBAL_MESSAGE,msg );
messages.add(ActionMessages.GLOBAL_MESSAGE,msg );
}

return errors;
}

and my jsp is
<html:messages id="error" message="true">
<li><bean:write name="error"/></li>
</html:messages>