users@jersey.java.net

[Jersey] Re: How to configure custom providers/resources using ResourceConfig

From: charlesk <charlesk40_at_yahoo.com>
Date: Tue, 2 Aug 2011 10:10:51 -0700 (PDT)

Actually no. I do mean Jersey filters (that implements
ContainerRequestFilter). I'm not using any of the servlet specifics since
the container I'm using is Netty.

It seems to me by looking at the PackagesResourceConfig class that takes in
the property map, there isn't a way for me to put the following params.

I need to be able to specify property params per filters.
For an example below:

   <filter>
        <filter-name>MyJerseyHelloWorldFilter1</filter-name>
       
<filter-class>yjava.ws.examples.helloworld.HelloWorldFilter2</filter-class>
                        <init-param>
                <param-name>helloworldfilter.disabled</param-name>
                    <param-value>false</param-value>
                </init-param>
                <init-param>
                    <param-name>format.allow</param-name>
                    <param-value>foo,bar</param-value>
                </init-param>
    </filter>

   <filter>
        <filter-name>MyJerseyHelloWorldFilter2</filter-name>
       
<filter-class>yjava.ws.examples.helloworld.HelloWorldFilter2</filter-class>
                        <init-param>
                <param-name>helloworldfilter.disabled</param-name>
                    <param-value>false</param-value>
                </init-param>
                <init-param>
                    <param-name>format.allow</param-name>
                    <param-value>foo,bar</param-value>
                </init-param>
    </filter>

So, I think what I need is a Map&lt;String, Map&lt;String, Object&gt;> where
I need to be able to specify
a key for the filter class and the map of params (name and value)
but seems like PackagesResourceConfig isn't fit for it.

Could there be any other config classes that I can look into or am I missing
something obvious here?
Thanks!

public PackagesResourceConfig(Map&lt;String, Object&gt; props) {
        this(getPackages(props));
        
        setPropertiesAndFeatures(props);
    }

--
View this message in context: http://jersey.576304.n2.nabble.com/How-to-configure-custom-providers-resources-using-ResourceConfig-tp6635080p6645651.html
Sent from the Jersey mailing list archive at Nabble.com.