AW: ActionMessages and ActionErrors

"Bernhard Woehrlin" <[email protected]>
Newsgroups gmane.comp.java.strutscx.user
Organization IT.CappuccinoNet.com
Message-ID <000e01c36ed4$3ed7d480$4c01a8c0@javaws>
Hi Nirmal,

if you want to error check user input make sure you add the
debugxml=true to the form you want to error check.

Regards,

Berny

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Nirmal
Rajarathnam
Gesendet: Samstag, 30. August 2003 00:00
An: [email protected]
Cc: [email protected]
Betreff: [Strutscx-user] ActionMessages and ActionErrors

Hi,
    I use strutscx 0.9.3 and I have an Action class where I try to set
ActionMessages and / or ActionErrors depending on situations as follows:
public class SomeAction extends org.apache.struts.action.Action {
 
    ActionForward execute(…) {
        try {
            executeSomeFunction();
            ActionMessages messages = new ActionMessages();
            String msg = “operation completed successfully”;
            messages.add("MSG_DONE", new ActionMessage(msg));
            this.saveMessages(request, messages);
            forward = StrutsCXConstants.FORWARD_SUCCESS;
        } catch (ServletException ex) {
            ActionErrors errors = new ActionErrors();
            errors.add(request.getRequestURI(),new
ActionMessage(ex.getMessage()));
            // set the ActionErrors to the Request
            request.setAttribute(StrutsCXConstants.XML_ERROR, errors);
            forward = StrutsCXConstants.FORWARD_ERROR;
        }
        return (mapping.findForward(forward));
    }
    …
    …
}
 
I am not able to successfully display these ActionErrors and
ActionMessages on the screen. When trying in the debug mode
(debugxml=true) the xml shows these as just object address not as
strings.
 
Any help would be greatly appreciated.
 
Thanks,
Nirmal R.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.