You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Navjot Singh <na...@net4india.net> on 2003/07/18 09:47:02 UTC

RE: Is it possible to get the ActionMapping object in a filter ?

correct me if i am wrong

The filter servlet is hit before the request reaches the main servlet -
ActionServlet in struts case. As the request has not even reached
ActionServlet, ActionMapping object has not been initialized as of now.

so, you CANNOT have Mapping object in filter

navjot

|-----Original Message-----
|From: Ajay Patil [mailto:apatil@vertex.co.in]
|Sent: Friday, July 18, 2003 1:20 PM
|To: struts-user@jakarta.apache.org
|Subject: Is it possible to get the ActionMapping object in a filter ?
|
|
|Hi,
|
|Is it possible to retrieve the Action mapping object in the Filter
|class ?
|
|To describe further, I am writing the filter (as per Servlet 2.3) to
|authenticate the Strut actions and was wondering if I could get
|the roles for the action triggered. I think Struts 1.1 allows for
|roles to be stored in the ActionMapping.
|
|Thanks in advance,
|Ajay
|
|
|---------------------------------------------------------------------
|To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
|For additional commands, e-mail: struts-user-help@jakarta.apache.org
|
|


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Is it possible to get the ActionMapping object in a filter ?

Posted by Erik Price <ep...@ptc.com>.

Navjot Singh wrote:
> correct me if i am wrong
> 
> The filter servlet is hit before the request reaches the main servlet -
> ActionServlet in struts case. As the request has not even reached
> ActionServlet, ActionMapping object has not been initialized as of now.

You can always have the access code performed in the Filter, *after* the 
filter chain has been invoked.  However, it might be of no use for your 
use case by that time.

MyFilter    ActionServlet     Mapping
    |             |               |
    |             |               |
    - doChain()   |               |
   | |----------->-               |
   | |           | | instantiates |
   | |           | |------------->-
   | |           | |             | |
   | |                           | |
   | |            getRoles       | |
   | |-------------------------->| |





Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Is it possible to get the ActionMapping object in a filter ?

Posted by Andrew Hill <an...@gridnode.com>.
ActionMappings are initialised at startup surely and available from the
servlet context?

-----Original Message-----
From: Navjot Singh [mailto:navjot.s@net4india.net]
Sent: Friday, 18 July 2003 15:47
To: Struts Users Mailing List
Subject: RE: Is it possible to get the ActionMapping object in a filter
?


correct me if i am wrong

The filter servlet is hit before the request reaches the main servlet -
ActionServlet in struts case. As the request has not even reached
ActionServlet, ActionMapping object has not been initialized as of now.

so, you CANNOT have Mapping object in filter

navjot

|-----Original Message-----
|From: Ajay Patil [mailto:apatil@vertex.co.in]
|Sent: Friday, July 18, 2003 1:20 PM
|To: struts-user@jakarta.apache.org
|Subject: Is it possible to get the ActionMapping object in a filter ?
|
|
|Hi,
|
|Is it possible to retrieve the Action mapping object in the Filter
|class ?
|
|To describe further, I am writing the filter (as per Servlet 2.3) to
|authenticate the Strut actions and was wondering if I could get
|the roles for the action triggered. I think Struts 1.1 allows for
|roles to be stored in the ActionMapping.
|
|Thanks in advance,
|Ajay
|
|
|---------------------------------------------------------------------
|To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
|For additional commands, e-mail: struts-user-help@jakarta.apache.org
|
|


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org