Or at least those who are left. This forum seems uncharacteristically empty although I think it is the official one. Isn't it? Anyway - I have another conundrum...
I am trying to redirect an action. Here are the details:
I have an Authentication Interceptor which intercepts a user, checks for a session, and based on the result then either sends him to the login action or just invokes the request. The code looks as follows:
I have no problems retrieving the action name and parameters from the current context, but how to properly set the action that is invoked escapes me. The solution proposed on the above mentioned homepage doesn't work for me due to 2 reasons:
1. I have actually implemented the solution provided, but I have no idea how to get the String which reveals the directory all my struts is being executed in. For example, a regular action on my server could be "http://localhost:8080/jk/administration/items.action". The namespace parameter provides "administration" and the actionname is "items", but I have no idea how to get "jk" from the context.
2. More importantly, the solution provided on the page requires a jsp page to re-redirect the user, which I find somewhat ugly. I'd much rather redirect the user directly from Java code invoked by Struts 2.
So I guess it all boils down to one question:
How do I force a new action into the actionInvocation context instead of the one it currently contains?