Hi,
Try the following:
Use saveMessages(request, messages) instead of saveErrors(request,
errors)
And use something like
<logic:messagesPresent message="true">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<html:messages id="message" message="true">
<tr>
<td> </td>
<td colspan="8" class="style1"><font color="red"><li><bean:write
name="message"/></li></font></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="8" class="style1"> </td>
<td> </td>
</tr>
</html:messages>
</logic:messagesPresent>
In your web page.
Regards
David.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 28 July 2005 13:35
To: [email protected]
Subject: Error Message Problem (Again)
Hi All,
Seems this is a constant area of irritation. I am attempting to put an
error message into the ActionMessage in an Action Class and redisplay
this
on a JSP page. This application is using tiles and is located in a
Struts
Module. Seems simple enough, but I can't get the darn thing to display
on
the JSP.
Here is extracts from my code.
Action Class:
public ActionForward execute(final ActionMapping mapping,
final
ActionForm form,
final
HttpServletRequest request,
final
HttpServletResponse response) {
ActionForward forward = mapping.findForward("fail");
ActionMessages errors = new ActionMessages();
...
errors.add("displayerror", new ActionMessage("myerror", false));
...
saveErrors(request, errors);
}
JSP Page:
<html:form action="/myAction.do" method="post">
<html:messages id="error" property="displayerror">
<bean:write name="error" />
</html:messages>
...
</html:form>
I have also tried:
<html:form action="/myAction.do" method="post">
<html:errors/>
...
</html:form>
Neither work
I inspect errors on the save error line and can see the error message in
the ActionMessage list, so I know it is being added to the request. I
also
used the false attribute to simply display "myerror" on the page to
eliminate the possibilty of a properties file typo problem. Any
recommendations on where to look?
This e mail is from DLA Piper Rudnick Gray Cary UK LLP.
The contents of this email and any attachments are confidential to the intended
recipient. They may not be disclosed to or used by or copied in any way by
anyone other than the intended recipient. If this email is received in error,
please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 111111
quoting the name of the sender and the email address to which it has been sent
and then delete it.
Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender
accept any responsibility for viruses and it is your responsibility to scan or
otherwise check this email and any attachments.
DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership
registered in England and Wales (registered number OC307847) which provides
services from offices in England, Belgium, Germany and the People's Republic of
China. A list of members is open for inspection at its registered office and
principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes
member of a limited liability partnership.
DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a
member of DLA Piper Rudnick Gray Cary, a global legal services organisation,
the members of which are separate and distinct legal entities. For further
information, please refer to www.dlapiper.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]