Hi , I am trying to implement security filter for application that ensures that the user is logged in before allowing access to any secured pages something like bugzooky .
When I start my application security filter(doFilter) is not getting invoked . I have just made following changes in web.xml & implemented security filter. Can pls tell me how to invoke doFilter of security filter <filter> <description>Provides login security for Anoigma</description> <filter-name>AnoigmaSecurityFilter</filter-name> <filter-class>com.anoigma.actionbean.SecurityFilter</filter-class> </filter> <filter-mapping> <filter-name>AnoigmaSecurityFilter</filter-name> <url-pattern>/Anoigma/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> <filter-mapping> <filter-name>AnoigmaSecurityFilter</filter-name> <url-pattern>/com/anoigma/actionbean/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> Thanks sneha --- On Thu, 19/3/09, Brandon Goodin <[email protected]> wrote: From: Brandon Goodin <[email protected]> Subject: Re: [Stripes-users] Stripes-Guice To: "Stripes Users List" <[email protected]> Date: Thursday, 19 March, 2009, 3:46 AM I actually started thinking about this question you asked... "What do you think about defining a Module[] factory as config param for the Lister, so the modules compatible to your framework are not limited to the default parameter less constructor?" This is exactly why I allow a custom InjectorFactory implementation to be created and configured. You could define your own if you needed Modules to be instantiated with parameters. The "Guice.Modules" context-param is strictly for the DefaultGuiceInjectorFactory. There isn't much to it. If you have another Factory that you think could provide common functionality for Stripes-Guice users then we could certainly add that to the code base. But we could add it as another type of InjectorFactory implementation. Brandon Goodin Silver Mind Software http://www.silvermindsoftware.com [email protected] 615-306-3652 http://www.linkedin.com/in/bgoodin On Wed, Mar 18, 2009 at 2:36 PM, Brandon Goodin <[email protected]> wrote: Wow... so many questions.. haha. Q. What do you think about how convenient it will be to write unit test für a java bean using this static method? ;-) And of course this breaks the LoD A. The ServletContext is easy to mock up. So as long as your unit test performs the Setup on the ServletContext you are fine. I would expect developers to use this judiciosly and not as a common means of accessing the injector. The static also allows me to more easily hook Guice functionality into Stripes. Q. Why use a Set<Injector>? are you planning to use multiple Injectors? A. Good question. The thought did cross my mind. But, I don't have any real use cases to support a reason for that. The actual reason for the Set had more to do with just having a convenient way to access a statically set variable from a non static method :) The Set works as a nice little container. Q. I'm wondering if somebody is extending the AnnotatedClassActionResolver. If so, this one will be stucked. I can only think of providing 2 base classes as solution - which seems a little bit ugly from my point of view. A. This *is* certainly not what I would consider the way I'd prefer to do things. But, it is the only solution available in Stripes 1.5. I implented Stripes-Spring the same way after extensive discussion with the Stripes devs. As a result of these and other conversations the Stripes gurus have made concessions in Stripes 1.6. Internally this will change with Stripes 1.6 because of the new ObjectFactory. I am working to create a stripes-guice for stripes 1.6. Q. I really do like the constructor based injection more than the setter based, but can it happen, that stripes autobinding overrides a property of your actionBean? Of course we are all security freaks und we all use strict binding but what about a less security aware programmer or some who doesn't use final? I don't trust myself, thats why I use the Interceptor/Setter based solution. Maybe a configuration param should enable/disable constructor based injection. A. I'm not sure I totally understand what you are saying. The constructor based injection would be for properties you aren't exposing to Stripes to override. I would expect something like a Service class not a domain object. But, heck... you could do whatever you wanted really. I don't want to get in the business of trying to stop folks from failing. It is way too much work and never pays off :D Q. What do you think about defining a Module[] factory as config param for the Lister, so the modules compatible to your framework are not limited to the default parameter less constructor? A. Great idea. I'll add it to my list of planned features. Q. How are you using the ActionBeanContext in your applications? I made the experience that i don't need more than the build in functions when using guice as DI framework. A. I am not currently using this in any of my projects. After implementing this I checked out Freddy's section on Stripes and Guice in his book and decided to add it because it was easy to do. Q. Are you planing to implement some logging? A. I don't have a specific plan. But, I could add that to my list of things to add. Thanks for the feedback Brandon Goodin Silver Mind Software http://www.silvermindsoftware.com [email protected] 615-306-3652 http://www.linkedin.com/in/bgoodin -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com -----Inline Attachment Follows----- _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <description> Stripes Examples </description> <display-name>Stripes Examples</display-name> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <!-- Configuration of the Stripes Filter. --> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <filter> <description> Provides essential configuration and request processing services for the Stripes framework. </description> <display-name>Stripes Filter</display-name> <filter-name>StripesFilter</filter-name> <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class> <!-- REQUIRED init parameter for the Stripes Filter. --> <init-param> <param-name>ActionResolver.Packages</param-name> <param-value>com.anoigma.actionbean</param-value> </init-param> <!-- Optional init parameter for the Stripes Filter. --> <init-param> <param-name>ActionBeanContext.Class</param-name> <param-value>com.anoigma.actionbean.AnoigmaActionBeanContext</param-value> </init-param> <!--<init-param> <param-name>Stripes.EncryptionKey</param-name> <param-value>Don't Copy/Paste Me! Make up your own encryption key and keep it secret!</param-value> </init-param>--> <init-param> <param-name>Interceptor.Classes</param-name> <param-value> net.sourceforge.stripes.integration.spring.SpringInterceptor </param-value> </init-param> </filter> <filter-mapping> <filter-name>StripesFilter</filter-name> <url-pattern>*.jsp</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> <filter-mapping> <filter-name>StripesFilter</filter-name> <servlet-name>StripesDispatcher</servlet-name> <dispatcher>REQUEST</dispatcher> </filter-mapping> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <!-- Configuration of Bugzooky security filter. --> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <filter> <description>Provides login security for Anoigma</description> <filter-name>AnoigmaSecurityFilter</filter-name> <filter-class>com.anoigma.actionbean.SecurityFilter</filter-class> </filter> <filter-mapping> <filter-name>AnoigmaSecurityFilter</filter-name> <url-pattern>/Anoigma/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> <filter-mapping> <filter-name>AnoigmaSecurityFilter</filter-name> <url-pattern>/com/anoigma/actionbean/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <!-- Configuration of the Stripes dispatcher Servlet. --> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <servlet> <servlet-name>StripesDispatcher</servlet-name> <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>StripesDispatcher</servlet-name> <url-pattern>/dispatcher</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>StripesDispatcher</servlet-name> <url-pattern>/action/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>StripesDispatcher</servlet-name> <url-pattern>*.action</url-pattern> </servlet-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring-context.xml</param-value> </context-param> </web-app>
SecurityFilter.java
Description: Binary data
------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
