You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shilpa Vaidya <sh...@icici-infotech.com> on 2004/06/03 12:11:12 UTC

Servlet filter

hey all,
Preventing users from accesing action. I am writing a web app to manage
administrators and profiles.
Administrators may access to the web app based on the profiles they have.
The profiles, determine which pages the administrator might access. The
profiles, and authorizations, might change online during work, so I need to
check authorization to access a page (Action) on each access.If I understand
correct, then, the actionServlet, first process the form bean, and then the
action..
But, if the user is not authorized to access a specific page (Action), I
need to forward him to an UnAuthorized error page, before thr formAction
bean is filled.
I would like to use a servlet filter. This filter checks the users rights
and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
anyone help.Till then me trying to study the ServletFilter examples here n
there.
Shilpa





-- 


"This e-mail message may contain confidential, proprietary or legally privileged information. It 
should not be used by anyone who is not the original intended recipient. If you have erroneously 
received this message, please delete it immediately and notify the sender. The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies,  (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of ICICI Group.Before opening any attachments please check them for viruses and defects." 



Re: Servlet filter

Posted by Nic Holbrook <mo...@xmission.com>.
I actually extended the Action class with a SecureAction class and 
created a Secure Action Mapping.  All actions that need to be secured 
extend this class.

In the struts config I have <set-property property="actionRole" 
value="40"/> for each action.  This way I validate at the role level for 
each action.  This works great since we build menus based on roles 
assigned to users.

Nic

Shilpa Vaidya wrote:

>hey all,
>Preventing users from accesing action. I am writing a web app to manage
>administrators and profiles.
>Administrators may access to the web app based on the profiles they have.
>The profiles, determine which pages the administrator might access. The
>profiles, and authorizations, might change online during work, so I need to
>check authorization to access a page (Action) on each access.If I understand
>correct, then, the actionServlet, first process the form bean, and then the
>action..
>But, if the user is not authorized to access a specific page (Action), I
>need to forward him to an UnAuthorized error page, before thr formAction
>bean is filled.
>I would like to use a servlet filter. This filter checks the users rights
>and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
>anyone help.Till then me trying to study the ServletFilter examples here n
>there.
>Shilpa
>
>
>
>
>
>  
>


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


RE: URL regd Servlet filter

Posted by Jose Ramon Diaz <jo...@aranzadi.es>.
> can you give an outline of the typeof problem you faced?

 I started one discussion last week, but it?hasn?t been answered :)
It said...

	I am trying to wrap the HttpServletResponse to apply gzip compression on
data sent to the client when gzip is supported. I'm using a filter,wrapper
and custom ServletOutputStream based on published code.
It seems to work except when I chain actions. If I call one action which
executes a forward to a JSP, I get the exception attached.

We have the filter applied only to *.do in <url-pattern> from web.xml, so we
thought the filter is applied to the actions, and the JSP.

We know this question has been asked several times, but we have not found a
good solution for us. what could I be doing that would cause the stream to
be closed? Can?t we put a filter to compress if we use forwards from
actions?

Thanks in advance!



-----Mensaje original-----
De: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
Enviado el: viernes, 04 de junio de 2004 10:50
Para: Struts Users Mailing List
Asunto: RE: URL regd Servlet filter



I am using filters and have some pages that forwards to a JSP(though I
should try avoiding that) I have not faced any problem yet. can you give an
outline of the typeof problem you faced?

"Jose Ramon Diaz" <jo...@aranzadi.es>
06/04/2004 02:05 PM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>

To"'Struts Users Mailing List'" <us...@struts.apache.org>,
<sh...@icici-infotech.com>
cc
SubjectRE: URL regd Servlet filter







Don?t you have problem with filters if the actions forward to JSP?
At least, I have a lot of problem with compression filters, as the container
seems to use another request for the JSP.

regards

> -----Mensaje original-----
> De: Prashanth.S [mailto:suman291857@yahoo.com]
> Enviado el: viernes, 04 de junio de 2004 10:13
> Para: Struts Users Mailing List; shilpa.vaidya@icici-infotech.com
> Asunto: Re: URL regd Servlet filter
>
>
> Hi,
> I think u should override actionservelet class in struts and
> configure struts-config.xml.......not so sure..left struts
> coding long back...take a look at below links...
> might help u...
> http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
> http://www.junlu.com/msg/30175.html
>
> Thanks
> Prashanth
>
>
>
>
> Shilpa Vaidya <sh...@icici-infotech.com> wrote:
>
> hey amit,
> the url is -
> http://prdownloads.sourceforge.net/securityfilter/securityfilt
> er-1.0.1.z
> We really need sound help. I have less time.Also in the book struts in
> action they mention filtering.
> How wud i start making my own servlet filter.expersts pls advice.
> Regd.
> shilpa
>
>
> ip?download
> -----Original Message-----
> From: Shilpa Vaidya [mailto:shilpa.vaidya@icici-infotech.com]
> Sent: Thursday, June 03, 2004 6:07 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Servlet filter
>
>
> Thanks brati,
> r u writing a servlet filter .
> how did u approach it.
> can u show me a starting point.
> shilpa
> -----Original Message-----
> From: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
> Sent: Thursday, June 03, 2004 5:59 PM
> To: Struts Users Mailing List
> Cc: 'Struts Users Mailing List'
> Subject: Re: Servlet filter
>
>
>
> Shilpa,
> We are doing just that. A filter comes into effect before the
> control goes
> to the servlet. So if you can stop the user at the filter
> level you are
> actually saving some processing. We are checking for the
> presence of session
> in the filter.
>
> Brati Sankar Ghosh
> Tata Consultancy Services
> Mailto: brati.sankarghosh@tcs.com
> Website: http://www.tcs.com
>
>
> "Shilpa Vaidya"
> 06/03/2004 03:41 PM
> Please respond to
> "Struts Users Mailing List"
>
>
> To "'Struts Users Mailing List'"
> cc
> Subject Servlet filter
>
>
>
>
>
>
>
> hey all,
> Preventing users from accesing action. I am writing a web app
> to manage
> administrators and profiles.
> Administrators may access to the web app based on the
> profiles they have.
> The profiles, determine which pages the administrator might
> access. The
> profiles, and authorizations, might change online during
> work, so I need
> to
> check authorization to access a page (Action) on each access.If I
> understand
> correct, then, the actionServlet, first process the form
> bean, and then
> the
> action..
> But, if the user is not authorized to access a specific page
> (Action), I
> need to forward him to an UnAuthorized error page, before thr
> formAction
> bean is filled.
> I would like to use a servlet filter. This filter checks the
> users rights
> and instanciates a HttpServletRequest-Wrapper.But am not sure
> how - .Can
> anyone help.Till then me trying to study the ServletFilter
> examples here n
> there.
> Shilpa
>
>
>
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or legally
> privileged information. It
> should not be used by anyone who is not the original intended
> recipient.
> If you have erroneously
> received this message, please delete it immediately and
> notify the sender.
> The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies,
> (collectively "ICICI
> Group"), are unable to exercise control or ensure or guarantee the
> integrity of/over the contents of the information contained in e-mail
> transmissions and further acknowledges that any views
> expressed in this message are those of the individual sender and no
> binding nature of the message shall be implied or assumed
> unless the sender
> does so expressly with due authority of ICICI Group.Before opening any
> attachments please check them for viruses and defects."
>
>
>
> ForwardSourceID:NT0000A91E
> --
>
>
> "This e-mail message may contain confidential, proprietary or legally
> privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If
> you have erroneously
> received this message, please delete it immediately and
> notify the sender.
> The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies,
> (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity
> of/over the contents of the information contained in e-mail
> transmissions
> and further acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding
> nature of the message shall be implied or assumed unless the
> sender does so
> expressly with due authority of ICICI Group.Before opening
> any attachments
> please check them for viruses and defects."
>
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or
> legally privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If you have erroneously
> received this message, please delete it immediately and
> notify the sender. The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies, (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity of/over the contents of the
> information contained in e-mail transmissions and further
> acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding nature of the message shall be implied or
> assumed unless the sender does so expressly with due
> authority of ICICI Group.Before opening any attachments
> please check them for viruses and defects."
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or
> legally privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If you have erroneously
> received this message, please delete it immediately and
> notify the sender. The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies, (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity of/over the contents of the
> information contained in e-mail transmissions and further
> acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding nature of the message shall be implied or
> assumed unless the sender does so expressly with due
> authority of ICICI Group.Before opening any attachments
> please check them for viruses and defects."
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger


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


ForwardSourceID:NT0000AB96


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


RE: URL regd Servlet filter

Posted by br...@tcs.com.
I am using filters and have some pages that forwards to a JSP(though I 
should try avoiding that) I have not faced any problem yet. can you give 
an outline of the typeof problem you faced?

Brati Sankar Ghosh
Tata Consultancy Services
Mailto: brati.sankarghosh@tcs.com
Website: http://www.tcs.com



"Jose Ramon Diaz" <jo...@aranzadi.es> 
06/04/2004 02:05 PM

Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
"'Struts Users Mailing List'" <us...@struts.apache.org>, 
<sh...@icici-infotech.com>
cc

Subject
RE: URL regd Servlet filter






Don?t you have problem with filters if the actions forward to JSP?
At least, I have a lot of problem with compression filters, as the 
container
seems to use another request for the JSP.

regards

> -----Mensaje original-----
> De: Prashanth.S [mailto:suman291857@yahoo.com]
> Enviado el: viernes, 04 de junio de 2004 10:13
> Para: Struts Users Mailing List; shilpa.vaidya@icici-infotech.com
> Asunto: Re: URL regd Servlet filter
>
>
> Hi,
> I think u should override actionservelet class in struts and
> configure struts-config.xml.......not so sure..left struts
> coding long back...take a look at below links...
> might help u...
> http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
> http://www.junlu.com/msg/30175.html
>
> Thanks
> Prashanth
>
>
>
>
> Shilpa Vaidya <sh...@icici-infotech.com> wrote:
>
> hey amit,
> the url is -
> http://prdownloads.sourceforge.net/securityfilter/securityfilt
> er-1.0.1.z
> We really need sound help. I have less time.Also in the book struts in
> action they mention filtering.
> How wud i start making my own servlet filter.expersts pls advice.
> Regd.
> shilpa
>
>
> ip?download
> -----Original Message-----
> From: Shilpa Vaidya [mailto:shilpa.vaidya@icici-infotech.com]
> Sent: Thursday, June 03, 2004 6:07 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Servlet filter
>
>
> Thanks brati,
> r u writing a servlet filter .
> how did u approach it.
> can u show me a starting point.
> shilpa
> -----Original Message-----
> From: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
> Sent: Thursday, June 03, 2004 5:59 PM
> To: Struts Users Mailing List
> Cc: 'Struts Users Mailing List'
> Subject: Re: Servlet filter
>
>
>
> Shilpa,
> We are doing just that. A filter comes into effect before the
> control goes
> to the servlet. So if you can stop the user at the filter
> level you are
> actually saving some processing. We are checking for the
> presence of session
> in the filter.
>
> Brati Sankar Ghosh
> Tata Consultancy Services
> Mailto: brati.sankarghosh@tcs.com
> Website: http://www.tcs.com
>
>
> "Shilpa Vaidya"
> 06/03/2004 03:41 PM
> Please respond to
> "Struts Users Mailing List"
>
>
> To "'Struts Users Mailing List'"
> cc
> Subject Servlet filter
>
>
>
>
>
>
>
> hey all,
> Preventing users from accesing action. I am writing a web app
> to manage
> administrators and profiles.
> Administrators may access to the web app based on the
> profiles they have.
> The profiles, determine which pages the administrator might
> access. The
> profiles, and authorizations, might change online during
> work, so I need
> to
> check authorization to access a page (Action) on each access.If I
> understand
> correct, then, the actionServlet, first process the form
> bean, and then
> the
> action..
> But, if the user is not authorized to access a specific page
> (Action), I
> need to forward him to an UnAuthorized error page, before thr
> formAction
> bean is filled.
> I would like to use a servlet filter. This filter checks the
> users rights
> and instanciates a HttpServletRequest-Wrapper.But am not sure
> how - .Can
> anyone help.Till then me trying to study the ServletFilter
> examples here n
> there.
> Shilpa
>
>
>
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or legally
> privileged information. It
> should not be used by anyone who is not the original intended
> recipient.
> If you have erroneously
> received this message, please delete it immediately and
> notify the sender.
> The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies,
> (collectively "ICICI
> Group"), are unable to exercise control or ensure or guarantee the
> integrity of/over the contents of the information contained in e-mail
> transmissions and further acknowledges that any views
> expressed in this message are those of the individual sender and no
> binding nature of the message shall be implied or assumed
> unless the sender
> does so expressly with due authority of ICICI Group.Before opening any
> attachments please check them for viruses and defects."
>
>
>
> ForwardSourceID:NT0000A91E
> --
>
>
> "This e-mail message may contain confidential, proprietary or legally
> privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If
> you have erroneously
> received this message, please delete it immediately and
> notify the sender.
> The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies,
> (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity
> of/over the contents of the information contained in e-mail
> transmissions
> and further acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding
> nature of the message shall be implied or assumed unless the
> sender does so
> expressly with due authority of ICICI Group.Before opening
> any attachments
> please check them for viruses and defects."
>
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or
> legally privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If you have erroneously
> received this message, please delete it immediately and
> notify the sender. The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies, (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity of/over the contents of the
> information contained in e-mail transmissions and further
> acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding nature of the message shall be implied or
> assumed unless the sender does so expressly with due
> authority of ICICI Group.Before opening any attachments
> please check them for viruses and defects."
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or
> legally privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If you have erroneously
> received this message, please delete it immediately and
> notify the sender. The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies, (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity of/over the contents of the
> information contained in e-mail transmissions and further
> acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding nature of the message shall be implied or
> assumed unless the sender does so expressly with due
> authority of ICICI Group.Before opening any attachments
> please check them for viruses and defects."
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger


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


ForwardSourceID:NT0000AB96 

RE: Sharing session beetwen HTTP and HTTPS

Posted by Jose Ramon Diaz <jo...@aranzadi.es>.
Ok, thanks.

This plugin works perfect!
And easy with this help:
http://sourceforge.net/forum/forum.php?thread_id=982448&forum_id=202074

Thanks again...


> -----Mensaje original-----
> De: David Friedman [mailto:humble@ix.netcom.com]
> Enviado el: viernes, 18 de junio de 2004 14:25
> Para: Struts Users Mailing List; jose.diaz@aranzadi.es
> Asunto: RE: Sharing session beetwen HTTP and HTTPS
>
>
> SSLExt: http://sslext.sourceforge.net
>
> -----Original Message-----
> From: Jose Ramon Diaz [mailto:jose.diaz@aranzadi.es]
> Sent: Friday, June 18, 2004 2:33 AM
> To: 'Struts Users Mailing List'
> Subject: Sharing session beetwen HTTP and HTTPS
>
>
> Hi all,
>
> 	We are triying to switch application state from HTTPS to HTTP.
> 	We want to use SSL connection only for login page. We
> execute a redirect if
> the user comes from SSL connection to the HTTP action without
> SSL. But the
> session is lost.
> 	We are using Oracle 9iAS, and we have tried a little
> application without
> Struts, where it works. This little application makes a
> redirect and after a
> forward to a JSP. The session is saved beetwen connections.
>
> 	Does anybody know if there is any problem to do this and Struts?
>
> 	Thanks in advance!
>
> 		Jose R.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


RE: Sharing session beetwen HTTP and HTTPS

Posted by David Friedman <hu...@ix.netcom.com>.
SSLExt: http://sslext.sourceforge.net

-----Original Message-----
From: Jose Ramon Diaz [mailto:jose.diaz@aranzadi.es]
Sent: Friday, June 18, 2004 2:33 AM
To: 'Struts Users Mailing List'
Subject: Sharing session beetwen HTTP and HTTPS


Hi all,

	We are triying to switch application state from HTTPS to HTTP.
	We want to use SSL connection only for login page. We execute a redirect if
the user comes from SSL connection to the HTTP action without SSL. But the
session is lost.
	We are using Oracle 9iAS, and we have tried a little application without
Struts, where it works. This little application makes a redirect and after a
forward to a JSP. The session is saved beetwen connections.

	Does anybody know if there is any problem to do this and Struts?

	Thanks in advance!

		Jose R.


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


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


Sharing session beetwen HTTP and HTTPS

Posted by Jose Ramon Diaz <jo...@aranzadi.es>.
Hi all,

	We are triying to switch application state from HTTPS to HTTP.
	We want to use SSL connection only for login page. We execute a redirect if
the user comes from SSL connection to the HTTP action without SSL. But the
session is lost.
	We are using Oracle 9iAS, and we have tried a little application without
Struts, where it works. This little application makes a redirect and after a
forward to a JSP. The session is saved beetwen connections.

	Does anybody know if there is any problem to do this and Struts?

	Thanks in advance!

		Jose R.


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


RE: URL regd Servlet filter

Posted by Jose Ramon Diaz <jo...@aranzadi.es>.
Don?t you have problem with filters if the actions forward to JSP?
At least, I have a lot of problem with compression filters, as the container
seems to use another request for the JSP.

regards

> -----Mensaje original-----
> De: Prashanth.S [mailto:suman291857@yahoo.com]
> Enviado el: viernes, 04 de junio de 2004 10:13
> Para: Struts Users Mailing List; shilpa.vaidya@icici-infotech.com
> Asunto: Re: URL regd Servlet filter
>
>
> Hi,
> I think u should override actionservelet class in struts and
> configure struts-config.xml.......not so sure..left struts
> coding long back...take a look at below links...
> might help u...
> http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
> http://www.junlu.com/msg/30175.html
>
> Thanks
> Prashanth
>
>
>
>
> Shilpa Vaidya <sh...@icici-infotech.com> wrote:
>
> hey amit,
> the url is -
> http://prdownloads.sourceforge.net/securityfilter/securityfilt
> er-1.0.1.z
> We really need sound help. I have less time.Also in the book struts in
> action they mention filtering.
> How wud i start making my own servlet filter.expersts pls advice.
> Regd.
> shilpa
>
>
> ip?download
> -----Original Message-----
> From: Shilpa Vaidya [mailto:shilpa.vaidya@icici-infotech.com]
> Sent: Thursday, June 03, 2004 6:07 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Servlet filter
>
>
> Thanks brati,
> r u writing a servlet filter .
> how did u approach it.
> can u show me a starting point.
> shilpa
> -----Original Message-----
> From: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
> Sent: Thursday, June 03, 2004 5:59 PM
> To: Struts Users Mailing List
> Cc: 'Struts Users Mailing List'
> Subject: Re: Servlet filter
>
>
>
> Shilpa,
> We are doing just that. A filter comes into effect before the
> control goes
> to the servlet. So if you can stop the user at the filter
> level you are
> actually saving some processing. We are checking for the
> presence of session
> in the filter.
>
> Brati Sankar Ghosh
> Tata Consultancy Services
> Mailto: brati.sankarghosh@tcs.com
> Website: http://www.tcs.com
>
>
> "Shilpa Vaidya"
> 06/03/2004 03:41 PM
> Please respond to
> "Struts Users Mailing List"
>
>
> To "'Struts Users Mailing List'"
> cc
> Subject Servlet filter
>
>
>
>
>
>
>
> hey all,
> Preventing users from accesing action. I am writing a web app
> to manage
> administrators and profiles.
> Administrators may access to the web app based on the
> profiles they have.
> The profiles, determine which pages the administrator might
> access. The
> profiles, and authorizations, might change online during
> work, so I need
> to
> check authorization to access a page (Action) on each access.If I
> understand
> correct, then, the actionServlet, first process the form
> bean, and then
> the
> action..
> But, if the user is not authorized to access a specific page
> (Action), I
> need to forward him to an UnAuthorized error page, before thr
> formAction
> bean is filled.
> I would like to use a servlet filter. This filter checks the
> users rights
> and instanciates a HttpServletRequest-Wrapper.But am not sure
> how - .Can
> anyone help.Till then me trying to study the ServletFilter
> examples here n
> there.
> Shilpa
>
>
>
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or legally
> privileged information. It
> should not be used by anyone who is not the original intended
> recipient.
> If you have erroneously
> received this message, please delete it immediately and
> notify the sender.
> The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies,
> (collectively "ICICI
> Group"), are unable to exercise control or ensure or guarantee the
> integrity of/over the contents of the information contained in e-mail
> transmissions and further acknowledges that any views
> expressed in this message are those of the individual sender and no
> binding nature of the message shall be implied or assumed
> unless the sender
> does so expressly with due authority of ICICI Group.Before opening any
> attachments please check them for viruses and defects."
>
>
>
> ForwardSourceID:NT0000A91E
> --
>
>
> "This e-mail message may contain confidential, proprietary or legally
> privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If
> you have erroneously
> received this message, please delete it immediately and
> notify the sender.
> The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies,
> (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity
> of/over the contents of the information contained in e-mail
> transmissions
> and further acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding
> nature of the message shall be implied or assumed unless the
> sender does so
> expressly with due authority of ICICI Group.Before opening
> any attachments
> please check them for viruses and defects."
>
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or
> legally privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If you have erroneously
> received this message, please delete it immediately and
> notify the sender. The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies, (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity of/over the contents of the
> information contained in e-mail transmissions and further
> acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding nature of the message shall be implied or
> assumed unless the sender does so expressly with due
> authority of ICICI Group.Before opening any attachments
> please check them for viruses and defects."
>
>
> --
>
>
> "This e-mail message may contain confidential, proprietary or
> legally privileged information. It
> should not be used by anyone who is not the original intended
> recipient. If you have erroneously
> received this message, please delete it immediately and
> notify the sender. The recipient
> acknowledges that ICICI Bank or its subsidiaries and
> associated companies, (collectively "ICICI
> Group"), are unable to exercise control or ensure or
> guarantee the integrity of/over the contents of the
> information contained in e-mail transmissions and further
> acknowledges that any views
> expressed in this message are those of the individual sender
> and no binding nature of the message shall be implied or
> assumed unless the sender does so expressly with due
> authority of ICICI Group.Before opening any attachments
> please check them for viruses and defects."
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger


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


Re: URL regd Servlet filter

Posted by "Prashanth.S" <su...@yahoo.com>.
Hi,
I think u should override actionservelet class in struts and configure struts-config.xml.......not so sure..left struts coding long back...take a look at below links...
might help u...
http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
http://www.junlu.com/msg/30175.html
 
Thanks
Prashanth
 
 


Shilpa Vaidya <sh...@icici-infotech.com> wrote:

hey amit,
the url is -
http://prdownloads.sourceforge.net/securityfilter/securityfilter-1.0.1.z
We really need sound help. I have less time.Also in the book struts in
action they mention filtering.
How wud i start making my own servlet filter.expersts pls advice.
Regd.
shilpa


ip?download
-----Original Message-----
From: Shilpa Vaidya [mailto:shilpa.vaidya@icici-infotech.com]
Sent: Thursday, June 03, 2004 6:07 PM
To: 'Struts Users Mailing List'
Subject: RE: Servlet filter


Thanks brati,
r u writing a servlet filter .
how did u approach it.
can u show me a starting point.
shilpa
-----Original Message-----
From: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
Sent: Thursday, June 03, 2004 5:59 PM
To: Struts Users Mailing List
Cc: 'Struts Users Mailing List'
Subject: Re: Servlet filter



Shilpa,
We are doing just that. A filter comes into effect before the control goes
to the servlet. So if you can stop the user at the filter level you are
actually saving some processing. We are checking for the presence of session
in the filter.

Brati Sankar Ghosh
Tata Consultancy Services
Mailto: brati.sankarghosh@tcs.com
Website: http://www.tcs.com


"Shilpa Vaidya" 
06/03/2004 03:41 PM
Please respond to
"Struts Users Mailing List" 


To "'Struts Users Mailing List'" 
cc
Subject Servlet filter







hey all,
Preventing users from accesing action. I am writing a web app to manage
administrators and profiles.
Administrators may access to the web app based on the profiles they have.
The profiles, determine which pages the administrator might access. The
profiles, and authorizations, might change online during work, so I need
to
check authorization to access a page (Action) on each access.If I
understand
correct, then, the actionServlet, first process the form bean, and then
the
action..
But, if the user is not authorized to access a specific page (Action), I
need to forward him to an UnAuthorized error page, before thr formAction
bean is filled.
I would like to use a servlet filter. This filter checks the users rights
and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
anyone help.Till then me trying to study the ServletFilter examples here n
there.
Shilpa





--


"This e-mail message may contain confidential, proprietary or legally
privileged information. It
should not be used by anyone who is not the original intended recipient.
If you have erroneously
received this message, please delete it immediately and notify the sender.
The recipient
acknowledges that ICICI Bank or its subsidiaries and associated companies,
(collectively "ICICI
Group"), are unable to exercise control or ensure or guarantee the
integrity of/over the contents of the information contained in e-mail
transmissions and further acknowledges that any views
expressed in this message are those of the individual sender and no
binding nature of the message shall be implied or assumed unless the sender
does so expressly with due authority of ICICI Group.Before opening any
attachments please check them for viruses and defects."



ForwardSourceID:NT0000A91E
--


"This e-mail message may contain confidential, proprietary or legally
privileged information. It
should not be used by anyone who is not the original intended recipient. If
you have erroneously
received this message, please delete it immediately and notify the sender.
The recipient
acknowledges that ICICI Bank or its subsidiaries and associated companies,
(collectively "ICICI
Group"), are unable to exercise control or ensure or guarantee the integrity
of/over the contents of the information contained in e-mail transmissions
and further acknowledges that any views
expressed in this message are those of the individual sender and no binding
nature of the message shall be implied or assumed unless the sender does so
expressly with due authority of ICICI Group.Before opening any attachments
please check them for viruses and defects."



-- 


"This e-mail message may contain confidential, proprietary or legally privileged information. It 
should not be used by anyone who is not the original intended recipient. If you have erroneously 
received this message, please delete it immediately and notify the sender. The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies, (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of ICICI Group.Before opening any attachments please check them for viruses and defects." 


-- 


"This e-mail message may contain confidential, proprietary or legally privileged information. It 
should not be used by anyone who is not the original intended recipient. If you have erroneously 
received this message, please delete it immediately and notify the sender. The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies, (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of ICICI Group.Before opening any attachments please check them for viruses and defects." 



		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

URL regd Servlet filter

Posted by Shilpa Vaidya <sh...@icici-infotech.com>.
hey amit,
the url is -
http://prdownloads.sourceforge.net/securityfilter/securityfilter-1.0.1.z
We really need sound help. I have less time.Also in the book struts in
action they mention filtering.
How wud i start making my own servlet filter.expersts pls advice.
Regd.
shilpa


ip?download
-----Original Message-----
From: Shilpa Vaidya [mailto:shilpa.vaidya@icici-infotech.com]
Sent: Thursday, June 03, 2004 6:07 PM
To: 'Struts Users Mailing List'
Subject: RE: Servlet filter


Thanks brati,
r u writing a servlet filter .
how did u approach it.
can u show me a starting point.
shilpa
  -----Original Message-----
  From: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
  Sent: Thursday, June 03, 2004 5:59 PM
  To: Struts Users Mailing List
  Cc: 'Struts Users Mailing List'
  Subject: Re: Servlet filter



  Shilpa,
  We are doing just that. A filter comes into effect before the control goes
to the servlet. So if you can stop the user at the filter level you are
actually saving some processing. We are checking for the presence of session
in the filter.

  Brati Sankar Ghosh
  Tata Consultancy Services
  Mailto: brati.sankarghosh@tcs.com
  Website: http://www.tcs.com


        "Shilpa Vaidya" <sh...@icici-infotech.com>
        06/03/2004 03:41 PM
              Please respond to
              "Struts Users Mailing List" <us...@struts.apache.org>


       To "'Struts Users Mailing List'" <us...@struts.apache.org>
              cc
              Subject Servlet filter







  hey all,
  Preventing users from accesing action. I am writing a web app to manage
  administrators and profiles.
  Administrators may access to the web app based on the profiles they have.
  The profiles, determine which pages the administrator might access. The
  profiles, and authorizations, might change online during work, so I need
to
  check authorization to access a page (Action) on each access.If I
understand
  correct, then, the actionServlet, first process the form bean, and then
the
  action..
  But, if the user is not authorized to access a specific page (Action), I
  need to forward him to an UnAuthorized error page, before thr formAction
  bean is filled.
  I would like to use a servlet filter. This filter checks the users rights
  and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
  anyone help.Till then me trying to study the ServletFilter examples here n
  there.
  Shilpa





  --


  "This e-mail message may contain confidential, proprietary or legally
privileged information. It
  should not be used by anyone who is not the original intended recipient.
If you have erroneously
  received this message, please delete it immediately and notify the sender.
The recipient
  acknowledges that ICICI Bank or its subsidiaries and associated companies,
(collectively "ICICI
  Group"), are unable to exercise control or ensure or guarantee the
integrity of/over the contents of the information contained in e-mail
transmissions and further acknowledges that any views
  expressed in this message are those of the individual sender and no
binding nature of the message shall be implied or assumed unless the sender
does so expressly with due authority of ICICI Group.Before opening any
attachments please check them for viruses and defects."



  ForwardSourceID:NT0000A91E
--


"This e-mail message may contain confidential, proprietary or legally
privileged information. It
should not be used by anyone who is not the original intended recipient. If
you have erroneously
received this message, please delete it immediately and notify the sender.
The recipient
acknowledges that ICICI Bank or its subsidiaries and associated companies,
(collectively "ICICI
Group"), are unable to exercise control or ensure or guarantee the integrity
of/over the contents of the information contained in e-mail transmissions
and further acknowledges that any views
expressed in this message are those of the individual sender and no binding
nature of the message shall be implied or assumed unless the sender does so
expressly with due authority of ICICI Group.Before opening any attachments
please check them for viruses and defects."



-- 


"This e-mail message may contain confidential, proprietary or legally privileged information. It 
should not be used by anyone who is not the original intended recipient. If you have erroneously 
received this message, please delete it immediately and notify the sender. The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies,  (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of ICICI Group.Before opening any attachments please check them for viruses and defects." 


-- 


"This e-mail message may contain confidential, proprietary or legally privileged information. It 
should not be used by anyone who is not the original intended recipient. If you have erroneously 
received this message, please delete it immediately and notify the sender. The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies,  (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of ICICI Group.Before opening any attachments please check them for viruses and defects." 



RE: Servlet filter

Posted by br...@tcs.com.
A filter will only work with servlet containers implementing servlet 
specifications 2.3.
We have a general filter which is extended by other filters doing various 
actions like xml processing,session validations and security logic.
Here is the generic filter code.

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
import javax.servlet.ServletException;
import pims.util.Logger;

public class PimsGenericFilter implements Filter
{
  private FilterConfig filterConfig;

  public void init(FilterConfig config)
  {
    filterConfig = config; 
  }
  public FilterConfig getFilterConfig()
  {
    return filterConfig;
  }

  public void setFilterConfig(FilterConfig filterconfig)
  {
    filterConfig = filterconfig;
  }
  public void doFilter(final ServletRequest request,final ServletResponse 
response, FilterChain chain)
        throws IOException, ServletException 
  { 
    chain.doFilter(request,response); 
 }
  public void destroy() 
  { 
     filterConfig = null; 
  } 

}

Brati Sankar Ghosh
Tata Consultancy Services
Mailto: brati.sankarghosh@tcs.com
Website: http://www.tcs.com



"Shilpa Vaidya" <sh...@icici-infotech.com> 
06/03/2004 06:06 PM

Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
"'Struts Users Mailing List'" <us...@struts.apache.org>
cc

Subject
RE: Servlet filter






Thanks brati,
r u writing a servlet filter .
how did u approach it.
can u show me a starting point.
shilpa
  -----Original Message-----
  From: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
  Sent: Thursday, June 03, 2004 5:59 PM
  To: Struts Users Mailing List
  Cc: 'Struts Users Mailing List'
  Subject: Re: Servlet filter



  Shilpa,
  We are doing just that. A filter comes into effect before the control 
goes
to the servlet. So if you can stop the user at the filter level you are
actually saving some processing. We are checking for the presence of 
session
in the filter.

  Brati Sankar Ghosh
  Tata Consultancy Services
  Mailto: brati.sankarghosh@tcs.com
  Website: http://www.tcs.com


        "Shilpa Vaidya" <sh...@icici-infotech.com>
        06/03/2004 03:41 PM
              Please respond to
              "Struts Users Mailing List" <us...@struts.apache.org>


       To "'Struts Users Mailing List'" <us...@struts.apache.org>
              cc
              Subject Servlet filter







  hey all,
  Preventing users from accesing action. I am writing a web app to manage
  administrators and profiles.
  Administrators may access to the web app based on the profiles they 
have.
  The profiles, determine which pages the administrator might access. The
  profiles, and authorizations, might change online during work, so I need
to
  check authorization to access a page (Action) on each access.If I
understand
  correct, then, the actionServlet, first process the form bean, and then
the
  action..
  But, if the user is not authorized to access a specific page (Action), I
  need to forward him to an UnAuthorized error page, before thr formAction
  bean is filled.
  I would like to use a servlet filter. This filter checks the users 
rights
  and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
  anyone help.Till then me trying to study the ServletFilter examples here 
n
  there.
  Shilpa





  --


  "This e-mail message may contain confidential, proprietary or legally
privileged information. It
  should not be used by anyone who is not the original intended recipient.
If you have erroneously
  received this message, please delete it immediately and notify the 
sender.
The recipient
  acknowledges that ICICI Bank or its subsidiaries and associated 
companies,
(collectively "ICICI
  Group"), are unable to exercise control or ensure or guarantee the
integrity of/over the contents of the information contained in e-mail
transmissions and further acknowledges that any views
  expressed in this message are those of the individual sender and no
binding nature of the message shall be implied or assumed unless the 
sender
does so expressly with due authority of ICICI Group.Before opening any
attachments please check them for viruses and defects."



  ForwardSourceID:NT0000A91E
-- 


"This e-mail message may contain confidential, proprietary or legally 
privileged information. It 
should not be used by anyone who is not the original intended recipient. 
If you have erroneously 
received this message, please delete it immediately and notify the sender. 
The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies, 
 (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the 
integrity of/over the contents of the information contained in e-mail 
transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no 
binding nature of the message shall be implied or assumed unless the 
sender does so expressly with due authority of ICICI Group.Before opening 
any attachments please check them for viruses and defects." 



ForwardSourceID:NT0000A9BE 

RE: Servlet filter

Posted by Shilpa Vaidya <sh...@icici-infotech.com>.
Thanks brati,
r u writing a servlet filter .
how did u approach it.
can u show me a starting point.
shilpa
  -----Original Message-----
  From: brati.sankarghosh@tcs.com [mailto:brati.sankarghosh@tcs.com]
  Sent: Thursday, June 03, 2004 5:59 PM
  To: Struts Users Mailing List
  Cc: 'Struts Users Mailing List'
  Subject: Re: Servlet filter



  Shilpa,
  We are doing just that. A filter comes into effect before the control goes
to the servlet. So if you can stop the user at the filter level you are
actually saving some processing. We are checking for the presence of session
in the filter.

  Brati Sankar Ghosh
  Tata Consultancy Services
  Mailto: brati.sankarghosh@tcs.com
  Website: http://www.tcs.com


        "Shilpa Vaidya" <sh...@icici-infotech.com>
        06/03/2004 03:41 PM
              Please respond to
              "Struts Users Mailing List" <us...@struts.apache.org>


       To "'Struts Users Mailing List'" <us...@struts.apache.org>
              cc
              Subject Servlet filter







  hey all,
  Preventing users from accesing action. I am writing a web app to manage
  administrators and profiles.
  Administrators may access to the web app based on the profiles they have.
  The profiles, determine which pages the administrator might access. The
  profiles, and authorizations, might change online during work, so I need
to
  check authorization to access a page (Action) on each access.If I
understand
  correct, then, the actionServlet, first process the form bean, and then
the
  action..
  But, if the user is not authorized to access a specific page (Action), I
  need to forward him to an UnAuthorized error page, before thr formAction
  bean is filled.
  I would like to use a servlet filter. This filter checks the users rights
  and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
  anyone help.Till then me trying to study the ServletFilter examples here n
  there.
  Shilpa





  --


  "This e-mail message may contain confidential, proprietary or legally
privileged information. It
  should not be used by anyone who is not the original intended recipient.
If you have erroneously
  received this message, please delete it immediately and notify the sender.
The recipient
  acknowledges that ICICI Bank or its subsidiaries and associated companies,
(collectively "ICICI
  Group"), are unable to exercise control or ensure or guarantee the
integrity of/over the contents of the information contained in e-mail
transmissions and further acknowledges that any views
  expressed in this message are those of the individual sender and no
binding nature of the message shall be implied or assumed unless the sender
does so expressly with due authority of ICICI Group.Before opening any
attachments please check them for viruses and defects."



  ForwardSourceID:NT0000A91E
-- 


"This e-mail message may contain confidential, proprietary or legally privileged information. It 
should not be used by anyone who is not the original intended recipient. If you have erroneously 
received this message, please delete it immediately and notify the sender. The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies,  (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of ICICI Group.Before opening any attachments please check them for viruses and defects." 



Re: Servlet filter

Posted by br...@tcs.com.
Shilpa,
We are doing just that. A filter comes into effect before the control goes 
to the servlet. So if you can stop the user at the filter level you are 
actually saving some processing. We are checking for the presence of 
session in the filter.

Brati Sankar Ghosh
Tata Consultancy Services
Mailto: brati.sankarghosh@tcs.com
Website: http://www.tcs.com



"Shilpa Vaidya" <sh...@icici-infotech.com> 
06/03/2004 03:41 PM

Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
"'Struts Users Mailing List'" <us...@struts.apache.org>
cc

Subject
Servlet filter






hey all,
Preventing users from accesing action. I am writing a web app to manage
administrators and profiles.
Administrators may access to the web app based on the profiles they have.
The profiles, determine which pages the administrator might access. The
profiles, and authorizations, might change online during work, so I need 
to
check authorization to access a page (Action) on each access.If I 
understand
correct, then, the actionServlet, first process the form bean, and then 
the
action..
But, if the user is not authorized to access a specific page (Action), I
need to forward him to an UnAuthorized error page, before thr formAction
bean is filled.
I would like to use a servlet filter. This filter checks the users rights
and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
anyone help.Till then me trying to study the ServletFilter examples here n
there.
Shilpa





-- 


"This e-mail message may contain confidential, proprietary or legally 
privileged information. It 
should not be used by anyone who is not the original intended recipient. 
If you have erroneously 
received this message, please delete it immediately and notify the sender. 
The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies, 
 (collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the 
integrity of/over the contents of the information contained in e-mail 
transmissions and further acknowledges that any views 
expressed in this message are those of the individual sender and no 
binding nature of the message shall be implied or assumed unless the 
sender does so expressly with due authority of ICICI Group.Before opening 
any attachments please check them for viruses and defects." 



ForwardSourceID:NT0000A91E 

R: Servlet filter

Posted by "Andrea M." <an...@fastwebnet.it>.
Hi Shilpa
I'm not sure you really need to use Filters for this purpose with Struts.
I think if you make sure you never access pages directly (maybe putting them
under WEB-INF... I've never done this but I know it's possible) but always
thru actions, then it shouldn't be difficult to implement a call to an
authentication component in your execute() method.

Should you absolutely need to authenticate thru a Filter, then it's not
difficult either

You first need to declare it in your web.xml like this:
  <filter>
    <filter-name>AuthFilter</filter-name>
    <filter-class>com.mypackage.AuthFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name> AuthFilter </filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

Then in your doFilter() method you call

   filterChain.doFilter(request, response)

if your user has authenticated successfully

otherwise you can redirect to some error page

-----Messaggio originale-----
Da: Shilpa Vaidya [mailto:shilpa.vaidya@icici-infotech.com] 
Inviato: giovedì 3 giugno 2004 12.11
A: 'Struts Users Mailing List'
Oggetto: Servlet filter

hey all,
Preventing users from accesing action. I am writing a web app to manage
administrators and profiles.
Administrators may access to the web app based on the profiles they have.
The profiles, determine which pages the administrator might access. The
profiles, and authorizations, might change online during work, so I need to
check authorization to access a page (Action) on each access.If I understand
correct, then, the actionServlet, first process the form bean, and then the
action..
But, if the user is not authorized to access a specific page (Action), I
need to forward him to an UnAuthorized error page, before thr formAction
bean is filled.
I would like to use a servlet filter. This filter checks the users rights
and instanciates a HttpServletRequest-Wrapper.But am not sure how - .Can
anyone help.Till then me trying to study the ServletFilter examples here n
there.
Shilpa





-- 


"This e-mail message may contain confidential, proprietary or legally
privileged information. It 
should not be used by anyone who is not the original intended recipient. If
you have erroneously 
received this message, please delete it immediately and notify the sender.
The recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies,
(collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity
of/over the contents of the information contained in e-mail transmissions
and further acknowledges that any views 
expressed in this message are those of the individual sender and no binding
nature of the message shall be implied or assumed unless the sender does so
expressly with due authority of ICICI Group.Before opening any attachments
please check them for viruses and defects." 




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


Re: problem with struts-tiles

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Have you configured the Tiles Plugin?

Niall

----- Original Message ----- 
From: "SASIDHAR BUDAMPATI" <sa...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Thursday, June 03, 2004 1:31 PM
Subject: problem with struts-tiles


> hi,
>
> When working with struts-tiles i have been encountered
> with the problem as below.
> please, suggest me how to rectify the problem.
>
> javax.servlet.ServletException: Can't get definitions
> factory from context.
>
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:673)
>
> org.apache.jsp.mainLayout_jsp._jspService(mainLayout_jsp.java:75)
>
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:285)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:232)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>
> root cause
>
> javax.servlet.jsp.JspException: Can't get definitions
> factory from context.
>
>
org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.jav
a:575)
>
>
org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:474
)
>
> org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:436)
>
>
org.apache.jsp.mainLayout_jsp._jspx_meth_tiles_insert_0(mainLayout_jsp.java:
90)
>
> org.apache.jsp.mainLayout_jsp._jspService(mainLayout_jsp.java:66)
>
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:285)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:232)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
> with regards,
> sasidhar
>
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


problem with struts-tiles

Posted by SASIDHAR BUDAMPATI <sa...@yahoo.com>.
hi,

When working with struts-tiles i have been encountered
with the problem as below.
please, suggest me how to rectify the problem.

javax.servlet.ServletException: Can't get definitions
factory from context.

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:673)

org.apache.jsp.mainLayout_jsp._jspService(mainLayout_jsp.java:75)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:285)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:232)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause 

javax.servlet.jsp.JspException: Can't get definitions
factory from context.

org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.java:575)

org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:474)

org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:436)

org.apache.jsp.mainLayout_jsp._jspx_meth_tiles_insert_0(mainLayout_jsp.java:90)

org.apache.jsp.mainLayout_jsp._jspService(mainLayout_jsp.java:66)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:285)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:232)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

with regards,
sasidhar




	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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


RES: Servlet filter

Posted by Fabrício Garcia Imbrizi <fa...@murah.com.br>.
Hi,

Create a generic Action class and for all another Action class created,
extends the generic Action.

Inside generic Action do anything, including authorizations user, log, etc.

The generic Action class has the execute(...) method and the last method
executed is an another execute() ex.: (executeBase(...))

For another created class, define the executeBase(...);

Ex.

public abstract class CentralAction extends Action
{
	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception
	{
		//do authorizations user, log, etc.

		...

		executeBase(mapping, form, request, response);
	}


	abstract public ActionForward executeBase(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception;

}

public class AnotherClassAction extends BaseAction
{
	public ActionForward executeBase(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception
	{
		...
	}
}


   Regardless

   Fabrício Garcia Imbrizi
   Murah Technologies
   11 8275 0199



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