Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Message Not Displaying on JSP(URGENT)

 
faisal khan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
faisal khan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i also try message="true" but i wont work
 
Pranav Sharma
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how I would do it, (now that ActionError is deprecated)

Action:


JSP:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic