I don't know where to post this

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

I don't know where to post this

jcvidal
Hi

I said in a previous post i'm implementing Ki with an external conf file instead of the ini-file-like in the web.xml. So, there is no config for the filter and OnePerRequestFilter.setFilterConfig() trap (about line #80) !

So this is my code :

    public void setFilterConfig(FilterConfig filterConfig) {
        this.filterConfig = filterConfig;
        if (this.filterConfig != null) {
        	setServletContext(filterConfig.getServletContext());
        }
    }


It's weird, but Ki seems to work even if the servletContext is no set :)


Best regards

Jean-Charles
Reply | Threaded
Open this post in threaded view
|

Re: I don't know where to post this

Les Hazlewood-2
Hi Jean-Charles,

This is perfectly fine.  As long as you define the KiFilter in web.xml, you can externalize your Apache Ki config in a ki.ini file at the root of the classpath.

For example:

<filter>
    <filter-name>KiFilter</filter-name>
    <filter-class>org.apache.ki.web.servlet.KiFilter</filter-class>
</filter>

Then just make sure that ki.ini is at the root of the classpath, and it will still work.

This allows the config to be externalized, which might be preferable if you don't want to bloat web.xml and/or you share configuration across one or more .war files.

Cheers,

Les

On Thu, Apr 30, 2009 at 8:00 AM, jcvidal <[hidden email]> wrote:

Hi

I said in a previous post i'm implementing Ki with an external conf file
instead of the ini-file-like in the web.xml. So, there is no config for the
filter and OnePerRequestFilter.setFilterConfig() trap (about line #80) !

So this is my code :

   public void setFilterConfig(FilterConfig filterConfig) {
       this.filterConfig = filterConfig;
       if (this.filterConfig != null) {
               setServletContext(filterConfig.getServletContext());
       }
   }


It's weird, but Ki seems to work even if the servletContext is no set :)


Best regards

Jean-Charles

--
View this message in context: http://n2.nabble.com/I-don%27t-know-where-to-post-this-tp2746641p2746641.html
Sent from the JSecurity User mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: I don't know where to post this

jcvidal
Hi, Les

In fact in my project, the conf file is :

a) a Xml file
b) located in a very strange place :)
c) sometimes built on the fly

But it das'nt matter ... Ki is a great job. Really !

Cheers

Jean-Charles



Les Hazlewood-2 wrote
Hi Jean-Charles,

This is perfectly fine.  As long as you define the KiFilter in web.xml, you
can externalize your Apache Ki config in a ki.ini file at the root of the
classpath.

For example:

<filter>
    <filter-name>KiFilter</filter-name>
    <filter-class>org.apache.ki.web.servlet.KiFilter</filter-class>
</filter>

Then just make sure that ki.ini is at the root of the classpath, and it will
still work.

This allows the config to be externalized, which might be preferable if you
don't want to bloat web.xml and/or you share configuration across one or
more .war files.

Cheers,

Les

On Thu, Apr 30, 2009 at 8:00 AM, jcvidal <jcvidal@improve.fr> wrote:

>
> Hi
>
> I said in a previous post i'm implementing Ki with an external conf file
> instead of the ini-file-like in the web.xml. So, there is no config for the
> filter and OnePerRequestFilter.setFilterConfig() trap (about line #80) !
>
> So this is my code :
>
>    public void setFilterConfig(FilterConfig filterConfig) {
>        this.filterConfig = filterConfig;
>        if (this.filterConfig != null) {
>                setServletContext(filterConfig.getServletContext());
>        }
>    }
>
>
> It's weird, but Ki seems to work even if the servletContext is no set :)
>
>
> Best regards
>
> Jean-Charles
>
> --
> View this message in context:
> http://n2.nabble.com/I-don%27t-know-where-to-post-this-tp2746641p2746641.html
> Sent from the JSecurity User mailing list archive at Nabble.com.
>
>