Morning First of all, apologies for the length, but I thought it best to give all the info I could!
I went away last night and from scratch built a Struts 1.2 project with a very simple form, an action and a piece of JSP (via a tile, which is the default way I do things). I get exactly the same problem as I received in "real" application; no ActionMessages are shown in the returned form, and there are no Request scope objects that look like they hold the ActionMessages. ] The objects after validation, which I know has worked as I get some info in my console, are: 2005-04-21 10:07:44,271 INFO [STDOUT] Request Object: javax.servlet.request.cipher_suite [SSL_RSA_WITH_RC4_128_MD5] 2005-04-21 10:07:44,271 INFO [STDOUT] Request Object: org.apache.struts.action.MESSAGE [class org.apache.struts.util.PropertyMessageResources] 2005-04-21 10:07:44,271 INFO [STDOUT] Request Object: javax.servlet.request.key_size [class java.lang.Integer] 2005-04-21 10:07:44,271 INFO [STDOUT] Request Object: org.apache.struts.action.mapping.instance [class org.apache.struts.action.ActionMapping] 2005-04-21 10:07:44,271 INFO [STDOUT] Request Object: simpleForm [class com.marshbourdon.validator.struts.form.SimpleForm] 2005-04-21 10:07:44,271 INFO [STDOUT] Request Object: org.apache.struts.action.MODULE [class org.apache.struts.config.impl.ModuleConfigImpl] My setup is thus: struts-config.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config> <data-sources /> <form-beans> <form-bean name="simpleForm" type="com.marshbourdon.validator.struts.form.SimpleForm" /> </form-beans> <global-exceptions /> <global-forwards> <forward name="test" path="test.do" /> </global-forwards> <action-mappings> <action path="/test" type="com.marshbourdon.validator.struts.action.TestAction" validate="false"> <forward name="success" path="test.messages" redirect="false" /> </action> <action attribute="simpleForm" input="test.messages" name="simpleForm" path="/testMessages" scope="request" type="com.marshbourdon.validator.struts.action.TestMessagesAction"> <forward name="success" path="test.messages" redirect="false" /> <forward name="failure" path="test.messages" redirect="false" /> </action> </action-mappings> <message-resources parameter="com.marshbourdon.validator.struts.ApplicationResources" /> <plug-in className="org.apache.struts.tiles.TilesPlugin"> <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" /> </plug-in> </struts-config> tiles-defs.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE component-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "tiles-config_1_1.dtd" > <component-definitions> <definition name="template" path="/jsp/templates/template.jsp"> <put direct="true" name="body" value="<body>" /> <put direct="true" name="description" value="Template" /> <put direct="true" name="keywords" value="" /> <put direct="true" name="title" value="Template" /> <put name="contentTile" value="/jsp/templates/content.jsp" /> </definition> <definition name="test.messages" extends="template"> <put direct="true" name="description" value="Messages Test" /> <put direct="true" name="keywords" value="" /> <put direct="true" name="title" value="Messages Test" /> <put name="contentTile" value="/jsp/messages/content.jsp" /> </definition> </component-definitions> content.jsp: <%@ page language="java"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> <div> <table class="Panel" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <div> <html:form action="/testMessages.do"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <html:text property="name" /> </td> <td> <html:messages id="error" property="name"> <font color="red"><bean:write name="error" /></font> </html:messages> </td> </tr> <tr> <td> <html:textarea property="description" /> </td> <td> <html:messages id="error" property="description"> <font color="red"><bean:write name="error" /></font> </html:messages> </td> </tr> <tr> <td> <html:submit /> </td> <td> <html:messages id="error"> <font color="red"><bean:write name="error" /></font> </html:messages> </td> </tr> </html:form> </div> </td> </tr> </table> </div> SimpleForm.java package com.marshbourdon.validator.struts.form; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import com.marshbourdon.validator.struts.StrutsHelper; public class SimpleForm extends ActionForm { private String description; private String name; public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // Perform validator framework validations ActionErrors errors = super.validate(mapping, request); if (errors == null) { errors = new ActionErrors(); } if (getName() == null || getName().length() == 0) { errors.add("name", new ActionMessage("errors.required", "Name")); } if (getDescription() == null || getDescription().length() == 0) { errors.add("description", new ActionMessage("errors.required", "Description")); } if (errors.size() > 0) { System.out.println("Errors: " + errors.size()); StrutsHelper.outputRequestObjects(request); } return null; } /** * Returns the description. * * @return String */ public String getDescription() { return description; } /** * Set the description. * * @param description The description to set */ public void setDescription(String description) { this.description = description; } /** * Returns the name. * * @return String */ public String getName() { return name; } /** * Set the name. * * @param name The name to set */ public void setName(String name) { this.name = name; } } -----Original Message----- From: Christopher Marsh-Bourdon [mailto:[EMAIL PROTECTED] Sent: 20 April 2005 18:55 To: user@struts.apache.org Subject: Re: Validation's disappearing messages Will do, I'm back at home now, so I'll email them out tomorrow morning. Tonight I am going to to attempt the whole thing from scratch with a new project and 1.2, see if that gives me the answer. Cheers Christopher Marsh-Bourdon www.marsh-bourdon.com > From: "Fogleson, Allen" <[EMAIL PROTECTED]> > Reply-To: "Struts Users Mailing List" <user@struts.apache.org> > Date: Wed, 20 Apr 2005 13:49:43 -0400 > To: "Struts Users Mailing List" <user@struts.apache.org> > Subject: RE: Validation's disappearing messages > > Christopher, > > It might help if you include portions of the offending code, > struts-config and such. I have seen this before but usually it is the > result of a bad config or such. > > Al > > > -----Original Message----- > From: Marsh-Bourdon, Christopher > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 20, 2005 11:22 AM > To: 'Struts Users Mailing List' > Subject: RE: Validation's disappearing messages > > Paul > > I am not redirecting. I am wondering whether it is the version of > Struts I > am on. I think tomorrow I will upgrade to 1.2. However, if anyone has > any > suggestions (polite), please let me know? > > Christopher Marsh-Bourdon > www.marsh-bourdon.com > > > > -----Original Message----- > From: Benedict, Paul C [mailto:[EMAIL PROTECTED] > Sent: 20 April 2005 16:56 > To: 'Struts Users Mailing List' > Subject: RE: Validation's disappearing messages > > > Chris, > > At first, make sure you are not redirecting. Error messages are request > based, and redirection equals two requests and thus the messages are not > persisted. > > -----Original Message----- > From: Marsh-Bourdon, Christopher > [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, April 20, 2005 11:52 AM > To: 'Struts Users Mailing List' > Subject: Validation's disappearing messages > > > Afternoon all > > Under Struts 1.1 (previously I have been using 1.0), I have validation > on a > form (it extends ValidatorActionForm) but after validation has failed > and I > have (within the validate method) logged the number of errors, I can not > for > the life of me get them to show within the JSP. I have followed the > examples in both the Struts Cookbook and the Struts site, but still to > no > avail. I raise errors on this form using both the Validation.xml and > manually, and I ensure that I return the errors object. > > I have also taken a dump of both the Request and Session for the user, > and I > find nothing that has a class of ActionErrors or ActionMessages. > > Has anyone had this problem and can help? I assume I doing something > really > silly that is ballsing this up. > > Cheers > > Christopher Marsh-Bourdon > ------ > > > ------------------------------------------------------------------------ > ---- > ---- > The information contained herein is confidential and is intended solely > for > the > addressee. Access by any other party is unauthorised without the express > written permission of the sender. If you are not the intended recipient, > please > contact the sender either via the company switchboard on +44 (0)20 7623 > 8000, or > via e-mail return. If you have received this e-mail in error or wish to > read > our > e-mail disclaimer statement and monitoring policy, please refer to > http://www.drkw.com/disc/email/ or contact the sender. 3167 > ------------------------------------------------------------------------ > ---- > ---- > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > ------------------------------------------------------------------------ > ---- > -- > Notice: This e-mail message, together with any attachments, contains > information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, > New > Jersey, USA 08889), and/or its affiliates (which may be known outside > the > United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, > as > Banyu) that may be confidential, proprietary copyrighted and/or legally > privileged. It is intended solely for the use of the individual or > entity > named on this message. If you are not the intended recipient, and have > received this message in error, please notify us immediately by reply > e-mail > and then delete it from your system. > ------------------------------------------------------------------------ > ---- > -- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ------ > > > ------------------------------------------------------------------------ > -------- > The information contained herein is confidential and is intended solely > for the > addressee. Access by any other party is unauthorised without the express > written permission of the sender. If you are not the intended recipient, > please > contact the sender either via the company switchboard on +44 (0)20 7623 > 8000, or > via e-mail return. If you have received this e-mail in error or wish to > read our > e-mail disclaimer statement and monitoring policy, please refer to > http://www.drkw.com/disc/email/ or contact the sender. 3167 > ------------------------------------------------------------------------ > -------- > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ------ -------------------------------------------------------------------------------- The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3166 -------------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]