ActionMessages and ActionErrors

"Nirmal Rajarathnam" <[email protected]>
Newsgroups gmane.comp.java.strutscx.user
Message-ID <[email protected]>
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.
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.