Title: How to remove global ActionErrors?
PageContext can be accessed directly from your Custom Tags. In fact from there is from where you get your other 'scopes'.
 
This way you reference the different scopes from within a Custom Tag:
 
     HttpSession session = pageContext.getSession();
     ServletContext application = pageContext.getServletContext();
     ServletRequest request = pageContext.getRequest();
Hope this helps :)
 
Regards.
 
                        Luis Olivares.
                 Infosphere S.A. de C.V.
     "Delivering the Power of Information"
    -------------------------------------------------------------
              (52)8-365-42-88 Ext. 107.
            [EMAIL PROTECTED]
----- Original Message -----
Sent: Friday, August 31, 2001 10:19 AM
Subject: How to remove global ActionErrors?


Hi again,

I have a CheckLoginTag class that verifies that there is a validUser stored in the session similar to the struts-example.  I have placed <app:checkLogin /> at the top of search.jsp which contains a searchForm. 

If a user tries to access this page without being logged in, they are forwarded to the login page as I would expect.  However, since they did not complete the searchForm, validation errors are added to the global ActionError and passed along with the forward.  As a result they see the Login page complete with a warning that they need to fill in the incomplete textboxes from the searchForm!

How do I remove the errors from the pageAttribute?  I know that somehow I need to add code to remove the Action.ERROR_KEY paramater from the request if CheckLoginTag determines that there is no user in the session, but I don't know how to access the pageContext from within CheckLoginTag . 

Has anyone got a code snippet I could see or perhaps a suggestion to implement the CheckLoginTag another way so that there isn't form validation processed first?

thanks,

kat

Reply via email to