Can I add ActionErrors in my JSP?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Matthew_Palmer
Posted On:   Friday, February 22, 2002 07:37 AM

I'm trying to add ActionErrors in my JSP. It seems like it should be fairly straightforward, but for some reason it's not working like I would expect it too. I have a JSP page that checks a few things at the very beginning and then if some things aren't set, then it redirects the user to my login.jsp. The in my login.jsp works great for errors that are generated within any Action class. But when I try to add the errors from the JSP, it's not making it to that errors tag. Here's a quick snippet of my code on my post.jsp: <% ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.key")); session.setAttribute(Action.ERROR_KEY, errors); %>   More>>

I'm trying to add ActionErrors in my JSP. It seems like it should be fairly straightforward, but for some reason it's not working like I would expect it too. I have a JSP page that checks a few things at the very beginning and then if some things aren't set, then it redirects the user to my login.jsp. The in my login.jsp works great for errors that are generated within any Action class. But when I try to add the errors from the JSP, it's not making it to that errors tag. Here's a quick snippet of my code on my post.jsp:


			
<% ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.key"));
session.setAttribute(Action.ERROR_KEY, errors);
%>




Anyway, I checked in my login.jsp file and had it tell me how many errors were in the ActionErrors attribute that I got from the session, and it told me I have 1 error when it gets to that page. So I think the error gets there fine, it's just not seeing it in that tag for some reason.

Any suggestions?



Thanks,

Matthew Palmer    <<Less

Re: Can I add ActionErrors in my JSP?

Posted By:   Ted_Husted  
Posted On:   Saturday, February 23, 2002 05:20 AM

Perhaps there is an empty ActionErrors object in the
request that is getting in the way..


The framework saves errors to the request, since
the errors would pertain only to that request thread.


HTH -Ted.

About | Sitemap | Contact