My application requires that users log on, so created a tag to check if the
requester has already logged on.  If not, this tag redirects him to a logon
page (/logon.jsp).  

I have found that if the validate() method of the form bean returns errors
and the user's session is lost (e.g. timed out), it takes the validation
errors that it would normally display on the failure page and instead shows
them on the /logon.jsp page (which also has an <html:errors/> tag).

Here are the steps I can take to demonstrate this effect:

1.  Log on to the app with the browser.

2.  Go to the /changePassword.jsp page.  Don't fill it out completely, so
validate() will return errors.  Don't submit the page yet, either.

3.  Restart the servlet engine (resin) which causes all sessions to be lost.

4.  Submit the page that was loaded in step 2

5.  The logon.jsp page is displayed, but so are the validation errors from
the incomplete /changePassword.jsp form.

How can I prevent the validation errors from being displayed when
redirecting to the logon page and still require users to log on?  I suspect
that the form bean returns errors to the changePassword.jsp (and never calls
the action class).  The changePassword.jsp has a <app:checkLogon/> tag and
this causes a forward to /logon.jsp

This is the relevant part of the code for the custom tag

  HttpSession session = pageContext.getSession();
  if ((session != null) && (session.getAttribute(name) != null))
    valid = true;

    if (valid)
      return(EVAL_PAGE);
    else
    {
      try
      {
        // ----> how do I clear out all ActionErrors here? <----
        pageContext.forward(page);
      } catch (Exception e) {
        throw new JspException(e.toString());
      }
      return(SKIP_PAGE);
    }
  }

Also, how could I redirect from within this custom tag instead of forward (I
want the URL to change).

Any ideas?

Thanks in advance,

tw

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to