You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Zhou, Qin (Eric)" <qz...@lucent.com> on 2004/08/04 18:58:15 UTC

Display Error Message

Hi

Does anybody know how I can display an error message which we got from exception? We don't want to define an error key in resource property file. We don't consider different Locale, only English.

Any suggestions?

Eric Zhou



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Display Error Message

Posted by Kishore Senji <ks...@gmail.com>.
If you want to display the message from Exception.getMessage() then,
Save the exception in to request 

request.setAttribute("exception", exception);

and in the jsp display it with <bean:write/>

<bean:write name="exception" property="message"/>

If you want to display a customized message for an exception, then you
should define
the mapping between exceptions and messages some where and the
properties files might be a
good place. You can define an ExceptionHandler or add an ActionMessage
corresponding to the exception.


On Wed, 4 Aug 2004 11:58:15 -0500 , Zhou, Qin (Eric) <qz...@lucent.com> wrote:
> Hi
> 
> Does anybody know how I can display an error message which we got from exception? We don't want to define an error key in resource property file. We don't consider different Locale, only English.
> 
> Any suggestions?
> 
> Eric Zhou
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org