Re: S2 custom authentication: remembering original request

2013-07-18 Thread Antonio Sánchez
Uploading files is not working. Files are not set in the action, there are no files in the request, and no files detected by File Upload Interceptor (FUI). Redirection Interceptor (RI) runs before the default stack FUI. RI stores in session the request parameters before FUI has any chance to

Re: S2 custom authentication: remembering original request

2013-07-16 Thread Antonio Sánchez
El Martes, 16 de julio de 2013 09:16:12 Antonios Gkogkakis escribió: Hi Antonio, I don't see anything different with the multipart requests, are you experiencing issues? I'll try to test multipart requests and will let you know. I must first review file uploading. The potential problem I

Re: S2 custom authentication: remembering original request

2013-07-16 Thread Antonios Gkogkakis
You don't have to store text, you can store Object or even the File itself. it depend on where/when you extract the params from the original request Antonios On 16 July 2013 09:51, Antonio Sánchez juntandolin...@gmail.com wrote: El Martes, 16 de julio de 2013 09:16:12 Antonios Gkogkakis

RE: S2 custom authentication: remembering original request

2013-07-16 Thread Martin Gainty
are set in web.xml as seen here mime-mapping extensionmysuffix/extension mime-typemymime/type/mime-type /mime-mapping -- or in mime.properties Martin Gainty __ Date: Tue, 16 Jul 2013 09:16:12 +0100 Subject: Re: S2 custom authentication

Re: S2 custom authentication: remembering original request

2013-07-16 Thread Antonio Sánchez
El Martes, 16 de julio de 2013 09:59:27 Antonios Gkogkakis escribió: You don't have to store text, you can store Object or even the File itself. it depend on where/when you extract the params from the original request In the interceptor. But the interceptor is not responsible of uploading. I

Re: S2 custom authentication: remembering original request

2013-07-16 Thread Antonio Sánchez
/extension mime-typemymime/type/mime-type /mime-mapping -- or in mime.properties __ Date: Tue, 16 Jul 2013 09:16:12 +0100 Subject: Re: S2 custom authentication: remembering original request From: gkogk...@tcd.ie

RE: S2 custom authentication: remembering original request

2013-07-16 Thread Dave Newton
On Jul 16, 2013 5:20 AM, Martin Gainty mgai...@hotmail.com wrote: be careful when storing params into session during redirect remember redirect invalidates the original session and creates a brand new session from client's browser That would mean if you redirected you'd be logged out every

Re: S2 custom authentication: remembering original request

2013-07-15 Thread Antonio Sánchez
The problem was I did not consider the namespace in the interceptor, config file and login action. action name=authenticate class... result type=chain param name=actionName${#session.action}/param param name=namespace${#session.space}/param

Re: S2 custom authentication: remembering original request

2013-07-15 Thread Antonios Gkogkakis
Hi Antonio, You can't modify the parameter map from the Servlet request, but you can pass the extra params from your first request to your action by putting them in the struts parameters map by calling invocation. getInvocationContext().getParameters().#put. So to recap, you have your

Re: S2 custom authentication: remembering original request

2013-07-15 Thread Antonio Sánchez
Hi Antonios. Thank you very much. I was using invocation.getProxy().getConfig().getParams() instead, but that returns an immutable map. It works using getInvocationContext().getParameters(). Thank you. I have to say that I'm not chaining actions: it doesn't make sense to remember the

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonio Sánchez
El Miércoles, 10 de julio de 2013 10:14:55 Dave Newton escribió: Or configure the server to run forwards through the filter. Sorry, I don't understand. On Jul 10, 2013 10:08 AM, Paul Benedict pbened...@apache.org wrote: Forwarding to another action means you want to do chaining:

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonios Gkogkakis
That doesn't do what you want because by not specifying the result type, the dispatcher result is used and it's trying to serve the /authenticar resource, which doesn't exist. action name=forward result/autenticar/result /action

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Rahul Tokase
Hi Here is the way you can achieve this. You need to design login action to have the url 'redirectto' parameter which will holds the redirectaction. Upon login interception you will first check the login is done and then check for this parameter if there any value then simply forward to that

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonio Sánchez
I'm having problems with chaining. I have tried several ways but none works. For instance: 1. http://localhost/mycontext/secure/protected = Login.jsp (${#request.url} is readable in jsp). 2. Login.jsp = submit (correct user/pwd) = ERROR: Infinite recursion detected:

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonios Gkogkakis
try request.setAttribute(url,invocation.getInvocationContext().getName()) in your interceptor. Antonios On 12 July 2013 12:03, Antonio Sánchez juntandolin...@gmail.com wrote: I'm having problems with chaining. I have tried several ways but none works. For instance: 1.

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonio Sánchez
El Viernes, 12 de julio de 2013 12:33:43 Antonios Gkogkakis escribió: try request.setAttribute(url,invocation.getInvocationContext().getName()) in your interceptor. Same result. Even using invocation.getProxy().getNamespace(). Antonios On 12 July 2013 12:03, Antonio Sánchez

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonios Gkogkakis
Have you added the Chaining interceptor ? Antonios On 12 July 2013 12:41, Antonio Sánchez juntandolin...@gmail.com wrote: El Viernes, 12 de julio de 2013 12:33:43 Antonios Gkogkakis escribió: try request.setAttribute(url,invocation.getInvocationContext().getName()) in your

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonio Sánchez
AFAIC, chaining interceptor is included in the default stack. Anyway I have added it and still same result. interceptor-ref name=chain/ !--- HERE -- interceptor-ref name=securityInteceptor / interceptor-ref name=chain/

Re: S2 custom authentication: remembering original request

2013-07-12 Thread Antonio Sánchez
If I use redirections I will lose the original request(parameters, uploading binary data ...). But I am unable to make it work using forwards (chaining actions). I give up. I can't do his with S2. I guess this use case requires some external approach: servlet filter (as Dave pointed out),

S2 custom authentication: remembering original request

2013-07-10 Thread Antonio Sánchez
Use Case: request some protected resource - redirect action for authentication - access protected resource. I'm using a custom interceptor that redirects (redirectAction) to a global result if no user object is found in session. The final action result then redirects to a login page. The

Re: S2 custom authentication: remembering original request

2013-07-10 Thread Dave Newton
Second question: because it's a redirect, hence a new request. Dave On Jul 10, 2013 7:28 AM, Antonio Sánchez juntandolin...@gmail.com wrote: Use Case: request some protected resource - redirect action for authentication - access protected resource. I'm using a custom interceptor that

Re: S2 custom authentication: remembering original request

2013-07-10 Thread CRANFORD, CHRIS
Date: Wed, 10 Jul 2013 14:27:29 To: Struts Users Mailing Listuser@struts.apache.org Reply-To: Struts Users Mailing List user@struts.apache.org Subject: S2 custom authentication: remembering original request Use Case: request some protected resource - redirect action for authentication - access

Re: S2 custom authentication: remembering original request

2013-07-10 Thread Antonio Sánchez
Second question: because it's a redirect, hence a new request. http://localhost:8084/mycontext/autenticar = login.jsp - OK Returned by interceptor: global-results result name=AUTENTICAR/autenticar/result /global-results

Re: S2 custom authentication: remembering original request

2013-07-10 Thread Antonio Sánchez
Users Mailing List user@struts.apache.org Subject: S2 custom authentication: remembering original request Use Case: request some protected resource - redirect action for authentication - access protected resource. I'm using a custom interceptor that redirects (redirectAction) to a global

Re: S2 custom authentication: remembering original request

2013-07-10 Thread Antonio Sánchez
Can't forward even without using global results: http://localhost:8084/mycontext/autenticar = login.jsp - OK action name=forward result/autenticar/result /action http://localhost:8084/mycontext/forward = 404 ERROR - /mycontext/autenticar not available

Re: S2 custom authentication: remembering original request

2013-07-10 Thread Paul Benedict
Forwarding to another action means you want to do chaining: http://struts.apache.org/release/2.3.x/docs/action-chaining.html result type=chain param name=actionNameautenticar/param /result On Wed, Jul 10, 2013 at 10:00 AM, Antonio Sánchez juntandolin...@gmail.comwrote: Can't forward even

Re: S2 custom authentication: remembering original request

2013-07-10 Thread Dave Newton
Or configure the server to run forwards through the filter. On Jul 10, 2013 10:08 AM, Paul Benedict pbened...@apache.org wrote: Forwarding to another action means you want to do chaining: http://struts.apache.org/release/2.3.x/docs/action-chaining.html result type=chain param