Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not able to display messages using ActionMessage....

Status
Not open for further replies.

kumar1973

Programmer
Aug 6, 2003
2
SG
I am encountering a problem with ActionMessages. The problem is that the message is not
getting displayed in the jsp. I dont know why. I have place application.properties file under
WEB-INF/.

Pls advise. Thanks for your help.

ActionCode
==========
ActionMessages messages = new ActionMessages();

try
{
messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(MessageConstant.DELETED));
}
catch (Exception e) {
e.printStackTrace();
}
finally
{
}

if(messages.size()>0)
{
saveMessages(request,messages);
}

return (mapping.findForward("success"));
}

===================================

MessageConstant.java
---------------------
public static final DELETED="1111";

===================================

struts-config.xml
------------------
<message-resources parameter=&quot;application&quot;/>

application.properties
----------------------
1111=Record Succesfully Deleted.

===================================
Jsp Page.

<logic:messagesPresent message=&quot;true&quot;>
Action result(s):
<ul><span>
<html:messages id=&quot;message&quot; message=&quot;true&quot;>
<logic:present name=&quot;message&quot;>
<li><bean:write name=&quot;message&quot;/></li>
</logic:present>
</html:messages></span>
</ul>
</logic:messagesPresent>
=====================================
 
I had the same problem. here is what i did. I placed the application.properties under my WEB-INF\classes\myJava folder instead.

in the xml file:-
<message-resources
parameter=&quot;myJava.ApplicationResources&quot;/>

that should fix it.

~za~
You can't bring back a dead thread!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top