Either use the <html:errors> or <html:messages> tag

http://struts.apache.org/userGuide/struts-html.html#errors
http://struts.apache.org/userGuide/struts-html.html#messages

Niall
----- Original Message ----- 
From: "Richard" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, October 06, 2004 10:53 AM
Subject: ActionMessages Help


> Hello Guys ,
>
> Im using DynaActionForms and I cant figure out how to display the
> messages I have created on the Action back to the jsp.
>
> Thanks in Advance
>
> Here are my codes....
>
> SubmitAction.java
> ===============
>         ActionMessages errors = new ActionMessages();
>         ActionMessage error = new ActionMessage( "license.notagree " ) ;
>         errors.add( "iagree" , error ) ;
>
>         if (!errors.isEmpty()) {
>             this.saveErrors(request, errors);
>             return (mapping.getInputForward());
>         }
>
>
> license.jsp
> =======
> <meta http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1"></meta>
> </head>
> <html:errors/>
> <body class="composite">
>             <jsp:include page="banner.jsp" />
> .
> .
> .
> .
>                     <div class="section">
>                         <html:form action="/submit-license.fss"
focus="iagree" >
>                         <html:checkbox property="iagree"/> I Agree.
>                         <html:submit property="Submit" value="Submit"/>
>                         </html:form>
>                     </div>
> </html>
>
>
> struts-config
> =========
>             <action
>                 path="/submit-license"
>                 type="com.freesoftswitch.actions.SubmitLicenseAction"
>                 name="LicenseForm"
>                 scope="request"
>                 input="/license.fss">
>               <forward name="failure" path="/serverpages/temp_google.jsp"
/>
>               <forward name="success" path="/serverpages/temp_google.jsp"
/>
>             </action>
>
> MessageResources.properties
> ======================
> license.notagree=You must agree !!!!
>
> ---------------------------------------------------------------------
> 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]

Reply via email to