What you can do is
if ( !"ur logic for validation") {
 ActionMessages actionMsg = new ActionMessages();
actionMsg.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("key in the
resource bundle"));
saveMessages(request,actionMsg);
return mapping.findForward("ur output view")
}

On ur jsp,
<html:messages> tag.
<html:messages id="message" message="true">
                              <bean:write name="message" />
                             </html:messages>

This should work for you.



On 6/6/06, marcus biel (innoWake gmbh) <[EMAIL PROTECTED]> wrote:

>You can use the ActionMessage constructor that takes a string and a
>boolean indicating whether or not the string is a key to be looked up
in
>a resource bundle. By setting this to false, the string is taken as a
>literal.
>
>public ActionForward execute(ActionMapping mapping, ActionForm form,
>            HttpServletRequest request, HttpServletResponse response){
>       ...
>         String myMessage = ...; // app logic that returns a string
>
>        ActionMessages errors = new ActionMessages();
>
>         // use GLOBAL_MESSAGE if message does not pertain to a
>specific property
>        errors.add(ActionMessages.GLOBAL_MESSAGE, new
>ActionMessage(myMessage, false));
>        saveErrors(request, errors);
>}

Okay, but how do I use internationalization from my property files?
In Version 1.0 or so, I used:

>ActionErrors errors = new ActionErrors();
>errors.add("MyError", new ActionError("error.MyError") );
>saveErrors(request,errors);

But that is deprecated.


Marcus


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




--
Regards
Name : Oshima Tlholoe
Cell No: +2773 342 4393
Tel No : +2712 350 1282(w)
E-mail : [EMAIL PROTECTED]
simplicity is the ultimate sophistication

Reply via email to