Results 1 to 3 of 3

Thread: Manage Servlet Filter

  1. #1
    Join Date
    Oct 2004
    Location
    Sardegna - Italy
    Posts
    39

    Default Manage Servlet Filter

    I have the necessity to manage the behavior of a servlet filter, but i have a doubt how to proceed.
    The filter it's not a bean, to register with a MBean with Spring JMX, perhaps FilterToBeanProxy used in Acegi can help me ?
    Someone has suggestions ?

  2. #2

    Default

    Just a sugestion: delegate the filter behaviour to a pojo that is controlled (and publsihed as an MBean) by spring. In the intialization of the filter you get a reference to this bean using
    Code:
    WebApplicationContextUtils.  getWebApplicationContext(servletContext).getBean("yourBean")
    Kees de Kooter

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    You need to find some way of communicating with the filter instance(s) which are not under Spring control. First of all see what the specs say about filters - do they create only one instance per server or per request(I think it's this one).
    If that's the case then you'd better find some way of externalizing the configuration - use JNDI to publish a configuration object; the filters will read it or smth while your JMX bean will act directly on it, forcing the filters to act as they should.
    In case you want just a read-only access it's pretty easy, if you want write also then you get into some synchronization issues.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Similar Threads

  1. after login redirects incorrectly
    By ryan.tyer in forum Security
    Replies: 1
    Last Post: Oct 10th, 2005, 05:16 PM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Replies: 4
    Last Post: Jun 16th, 2005, 09:48 AM
  4. Replies: 4
    Last Post: May 29th, 2005, 07:39 AM
  5. Replies: 5
    Last Post: Mar 18th, 2005, 04:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •