Sorry, but I've been reading archives all morning.

Using Struts 1.2.7

Setting up a system to catch all errors/messages on a page.

Getting the errors from my ActionForm:

ActionErrors errors = new ActionErrors();
errors.add("system_name",new ActionError("errors.required",ar.getMessage("com.draegoonZ.social.label.system_name")));
return(errors);

Getting the ???bad_key??? from my ActionForm:

ActionMessages errors = new ActionMessages();
errors.add("system_name",new ActionMessage(ar.getMessage("com.draegoonZ.social.password.lookup.no_user_name")));
saveMessages(request,errors);
return(mapping.getInputForward());

Results in: ???en_US.That username doesn't exist in our system. Please try again.???

Now I don't know what key it is telling me is missing,
when it is displaying the value from my messages resource.

I thought the problem was with using the property (system_name)
instead of ActionMessages.GLOBAL_MESSAGE, but that gave the
same results.

Also, I want to use the property name, so I can display next to the <html:> input tag.

A related question I have is:

I read somewhere (this morning) that once html:message is read/accessed that it is removed/deleted.
Is this true?
How then could one list all the errors/messages at the top of a page,
and then check for them to display next to the <html:> input tag?


My jsp reads:

        <%-- check for errors --%>
        <logic:messagesPresent>
<html:messages id="message_id" header="errors.header" footer="errors.footer">
               <li><c:out value="${message_id}" /></li>
           </html:messages>
       </logic:messagesPresent>

       <%-- If not errors present... --%>
       <logic:messagesNotPresent>

           <%-- check for messages (Globals.MESSAGE_KEY) --%>
           <logic:messagesPresent message="true">
<html:messages id="message_id" message="true" header="errors.header" footer="errors.footer">
                   <li><c:out value="${message_id}" /></li>
               </html:messages>
           </logic:messagesPresent>
       </logic:messagesNotPresent>


Thanx in advance.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to