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 Error Message Not Displaying on JSP(URGENT) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error Message Not Displaying on JSP(URGENT)" Watch "Error Message Not Displaying on JSP(URGENT)" New topic
Author

Error Message Not Displaying on JSP(URGENT)

faisal khan
Ranch Hand

Joined: Mar 13, 2002
Posts: 47
Hello
I am using jakarta-struts-1.2.4 and the code is below

On JSP i write

<logic:messagesPresent property="error">
<html:messages property="error" id="errMsg">
<bean:write name="errMsg"/>
</html:messages>
</logic:messagesPresent>

On ActionClass i write

messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("error.INVALIDUID"));
this.saveMessages(req,messages);
return mapping.findForward("fail");
Bhavik Patel
Ranch Hand

Joined: Jul 12, 2004
Posts: 155
On JSP i write

<logic:messagesPresent message="true">
<html:messages id="errMsg">
<bean:write name="errMsg"/>
</html:messages>
</logic:messagesPresent>

On ActionClass i write

messages = new ActionMessages();
messages.add("failure",new ActionMessage("error.INVALIDUID"));
saveMessages(req,messages);
return mapping.findForward("fail");


Let me know if it works or not


SCJP 1.4<br />SCWCD 1.4(91%)<br />Working on SCJD -Bodgitt & Scrapper Constructions...<br /> <br />"It takes 43 muscles to frown & 17 to smile but it doen't take any to just sit there with a dumb look on your face .. Keep Smiling "
faisal khan
Ranch Hand

Joined: Mar 13, 2002
Posts: 47
i also try message="true" but i wont work
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 258
This is how I would do it, (now that ActionError is deprecated)

Action:


JSP:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error Message Not Displaying on JSP(URGENT)