You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by J- <jm...@hotmail.com> on 2016/01/09 19:27:28 UTC

Camel jetty filtersRef how to set init parameters for filter

Hi i see how you can set a servlet filter on the Jetty component with the filtersRef option, but i need to set a couple init parameters on the filter object when it's init gets called.


Is this possible to do?


Thanks.

Re: Camel jetty filtersRef how to set init parameters for filter

Posted by Willem Jiang <wi...@gmail.com>.
I can reproduce the issue, so I just fill a JIRA[1] to add a new option of initParameters to the jetty endpoint uri. You can setup those parameters for your filter.


[1]https://issues.apache.org/jira/browse/CAMEL-9501 

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 10, 2016 at 10:10:39 PM, J- (jmandawg@hotmail.com) wrote:
> The problem is, when jetty starts up the filter it calls the filters init method again  
> essentially erasing whatever i set in the init manually.
>  
> -J
>  
> ________________________________________
> From: Willem Jiang  
> Sent: Sunday, January 10, 2016 4:47 AM
> To: users@camel.apache.org; J-
> Subject: Re: Camel jetty filtersRef how to set init parameters for filter
>  
> As camel-jetty doesn’t leverage the web.xml to setup the filters, I don’t think there  
> is a blocker when calling the filter init method yourself.
> When you setup the filters instance to the Camel registry, you can call the filter init  
> method to pass the parameters yourself.
>  
>  
> --
> Willem Jiang
>  
>  
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>  
>  
>  
> On January 10, 2016 at 2:27:44 AM, J- (jmandawg@hotmail.com) wrote:
> > Hi i see how you can set a servlet filter on the Jetty component with the filtersRef option,  
> > but i need to set a couple init parameters on the filter object when it's init gets called.  
> >
> >
> > Is this possible to do?
> >
> >
> > Thanks.
> >
>  
>  


Re: Camel jetty filtersRef how to set init parameters for filter

Posted by J- <jm...@hotmail.com>.
The problem is, when jetty starts up the filter it calls the filters init method again essentially erasing whatever i set in the init manually.

-J

________________________________________
From: Willem Jiang <wi...@gmail.com>
Sent: Sunday, January 10, 2016 4:47 AM
To: users@camel.apache.org; J-
Subject: Re: Camel jetty filtersRef how to set init parameters for filter

As camel-jetty doesn’t leverage the web.xml to setup the filters, I don’t think there is a blocker when calling the filter init method yourself.
When you setup the filters instance to the Camel registry, you can call the filter init method to pass the parameters yourself.


--
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem



On January 10, 2016 at 2:27:44 AM, J- (jmandawg@hotmail.com) wrote:
> Hi i see how you can set a servlet filter on the Jetty component with the filtersRef option,
> but i need to set a couple init parameters on the filter object when it's init gets called.
>
>
> Is this possible to do?
>
>
> Thanks.
>


Re: Camel jetty filtersRef how to set init parameters for filter

Posted by Willem Jiang <wi...@gmail.com>.
As camel-jetty doesn’t leverage the web.xml to setup the filters, I don’t think there is a blocker when calling the filter init method yourself. 
When you setup the filters instance to the Camel registry, you can call the filter init method to pass the parameters yourself.


--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 10, 2016 at 2:27:44 AM, J- (jmandawg@hotmail.com) wrote:
> Hi i see how you can set a servlet filter on the Jetty component with the filtersRef option,  
> but i need to set a couple init parameters on the filter object when it's init gets called.  
>  
>  
> Is this possible to do?
>  
>  
> Thanks.
>