I have a situation where when I click on a link struts takes me to the login page, and the url for the link is not the login page - it's an action class. Here are some details:
Theres a load action class, a date page where the user enters some dates, and a handler action class. The load action class puts some info in the form bean, it's displayed on the date page. The user enters some dates and hits submit, the dates are submitted to the handler action class and things are good. If the dates are formatted incorrectly, the form bean validation returns some error ActionMessages. (The form bean is session scoped). If I now go back to the page with the link to the load action class, which will display the date page, and I click that link, I go to the login page. I'm not supposed to go to the login page, I'm supposed to go to the date page.
Previously I saw a problem where the erroneous data was left in the form bean, and when the load action class was called at a later time, struts was performing validation before invoking the load action class, the validation was failing, and I was being sent to the login page. I have since added some flags to the chain and now the validation doesn't happen preceding the load action class, it only happens preceding the handler action class, and it seems to work fine. However in this latest situation, I'm never entering the validation method, constructor, or reset method on the form bean, I'm just being sent to the login page before any form bean or action class processing takes place.
So I loaded the struts source into my IDE and stepped through the ActionServlet code. For some reason when I click on the link to the load action class, and the ActionServlet.doGet() executes, the HttpServletRequest contains the uri for the login page, not my load action class. How could that be happening?
THANKS for any help! Steve
Joined: Mar 27, 2005
I discovered that if I clear the Firefox cache before clicking the link (authenticated sessions, cache, and browsing history) that it fixes the problem.