You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vinicius Carvalho <ca...@superig.com.br> on 2004/01/15 12:23:49 UTC
Struts and Action errors
Hi there! I'm a newbie to Struts, and this question may be a little silly,
sorry.
How exactly do I use action errors? How do I render them? In my app, I
control the session via RequestProcessor using processPreProcess method. If
the session is invalid, I create a new error using
ActionErrors errors = new ActionErrors();
errors.add("sessionExpired", new ActionError("errors.sessionExpired");
Well, and then I redirect the user to the desired login page, and there I have
<html:errors property="sessionExpired"/>
But nothing is shown. Also, in my actionForms, in the validate method, I
add errors using the same syntax and none are shown either.
In the Actions classes, the examples created by Websphere, I see that
everytime those actionErrors are saved using a method called saveErrors,
but this method is not static and belongs to Action class, the other
modules does not access it.
Any help?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Struts and Action errors
Posted by Richard Hightower <rh...@arc-mind.com>.
Did you put the messages in the resource bundle?
-----Original Message-----
From: Vinicius Carvalho [mailto:carvalho.vinicius@superig.com.br]
Sent: Thursday, January 15, 2004 4:24 AM
To: struts-user@jakarta.apache.org
Subject: Struts and Action errors
Hi there! I'm a newbie to Struts, and this question may be a little silly,
sorry.
How exactly do I use action errors? How do I render them? In my app, I
control the session via RequestProcessor using processPreProcess method. If
the session is invalid, I create a new error using
ActionErrors errors = new ActionErrors();
errors.add("sessionExpired", new ActionError("errors.sessionExpired");
Well, and then I redirect the user to the desired login page, and there I
have
<html:errors property="sessionExpired"/>
But nothing is shown. Also, in my actionForms, in the validate method, I
add errors using the same syntax and none are shown either.
In the Actions classes, the examples created by Websphere, I see that
everytime those actionErrors are saved using a method called saveErrors,
but this method is not static and belongs to Action class, the other
modules does not access it.
Any help?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org