i wrote an interceptor, that i would like to be invoked after excecuting an action and before showing the results:
the interceptor codes needs to check that 20 minutes didn't pass since session started. (i didn't declared the session end time in web.xml since it comes from the database as a parameter).
However, when i run it - the browser gets into an endless loop.
Okay I'm really not sure what you are trying to achieve with that code, but are you only trying to send the user to a different result page if the session has expired?? If so, why are you doing that after the action has executed?? Any user with no session should generally not even have access to the action. And if the actual goal is just to implement session timeout, you can set the session timeout of the session object from the value of the database in your action or a filter. The browser is going into a loop because session-timeout is a redirect result. So the browser will make a new request for that result, and then the interceptor will be fired again which will again redirect the browser. The solution is that you do not apply this interceptor to the getMainAction action...
Just leave the default stack that you've created as it is and use a different interceptor stack for that particular action. Look at the configurations in this page to see how its done...