Re: Unable to get ActionEroor messages

Claudia Nölker <[email protected]>
Newsgroups gmane.comp.java.strutscx.user
Message-ID <[email protected]>
Hi Koti,

as far as I know, StrutxCX does not make any use of the second argument
to the add() method of the ActionError object. It just re-uses the
function and therefore you have to provide an ActionMessage object.
It doesn't matter, what you put in there.

StrutsCX checks the input only by the Action class. If there is an
error, you will see the keys in the xml document, just like you do
in the example you sent.

What I am usually doing to display any error-messages to the user
is to put the error messages in the respective variables_XX.xml
files and then display them e.g. like this:

<xsl:if test="/root/errors/string_too_short">
  <xsl:value-of select="/root/variables/page/search/errors/string_too_short"/>
</xsl:if>

Hope this helps.

Greetings,
Claudia

From "Reddy, Koti" <[email protected]> on Thu, Jun 17, 2004 at 10:32:12AM -0400
> 
> Hi Alex,
>   But why am I seeing my keys in the xml document?
> 
> <errors>
>    <assignTo />
>     <prodLineCd />
> </errors>
> 
> It should show <errors></errors> right?
> 
> I don't think it is a different request to the server. I am saying
> redirect="false" in the struts-config file. So it should use the same
> request.
> 
> Here is the snippet of my config xml
> 
>     <action name="appAcctActionForm"
> 		type="com.ustrust.acm.strutscx.action.AppAcctSaveAction"
> 
> 		path="/approve_acct_save"
> 		validate="false"
> 		redirect="false">
>       <forward name="acctMgtTasks"     path="/acct_mgmt.do" />
> 	 <forward name="error" 	   	   path="/approve_acct_open.do"
> />
>       <forward name="viewFilledForm"
> path="/approve_acct_open.do?debugxml=true"  redirect="false"/>	 
>     </action>
> 
> and this is what I do in my action class
> 
>     request.setAttribute("appAcctActionForm", appAcctBean);   
>     request.setAttribute("errors", actionErrs);   
>     return (mapping.findForward(StrutsCXConstants.FORWARD_FILLED_FORM));
> 
> Let me know if I am doing anything wrong?
> 
> Thank you
> Koti Reddy
> 
> 
> -----Original Message-----
> From: Alexander Bischof [mailto:[email protected]]
> Sent: Thursday, June 17, 2004 10:26 AM
> To: Reddy, Koti
> Cc: [email protected]
> Subject: Re: [Strutscx-user] Unable to get ActionEroor messages
> 
> Hello Reddy,
> 
> i have the same behavior, but i think this is correct. When you want to
> see the XML document, you send a new request to the server, where now no
> 
> error is set.
> 
> @all Correct me, if i'm wrong.
> 
> greets
> Alex
> 
> Reddy, Koti wrote:
> 
> > Hi Guys,
> >
> >     I am unable to get the ActionError messages in the xml document.
> > It gives the keys but not the error message. I would appreciate if any
> 
> > one can help me in this.
> >
> > 
> >
> > This is what I do in my formBean
> >
> > ActionErrors errors = new ActionErrors();
> >
> > 
> >
> >     errors.add("assignTo",new ActionError("PRODUCT LINE AND PRODUCT
> > ARE NOT GOOD"));
> >
> >     errors.add("prodLineCd",new ActionError("PRODUCT DESCRIPTION IS
> > NOT GOOD"));
> >
> > 
> >
> >     logger.info(THIS_CLASS + "AFTER ADDING ACTIONERRORS");
> >
> >     return errors;
> >
> > 
> >
> > and this is what I see when I do debugxml=true
> >
> > 
> >
> > - <!--
> >
> >********** ERROR PARAMETERS **********
> >
> > * * -->
> >
> > *-* <http://ustjc3asdv1:7001/acm/approve_acct_save.do##> <errors>
> >
> > * * <assignTo />
> >
> > * * <prodLineCd />
> >
> > * * </errors>
> >
> > 
> >
> 
> ---------------------------------------------------------------------
> The message contains confidential and/or legally privileged
> information and is intended for use by the indicated addressee. 
> 
> If you are not the intended addressee: (a) any disclosure,
> reproduction, distribution or action you take because of it is
> strictly prohibited; (b) please return the complete message to the
> sender; and (c) this message is not a solicitation for purchase or
> sale or an agreement of any kind whatsoever that binds the sender.
> ---------------------------------------------------------------------
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> Strutscx-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/strutscx-user


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
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.