tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From be...@bellatlantic.net
Subject Re: How do I get context-params that are set in the web.xml file?
Date Fri, 29 Jun 2001 14:17:11 GMT
Antony,

    Thanks a lot for taking the time to answer a beginners question.

    --beeky

Antony Bowesman wrote:

> beeky@bellatlantic.net wrote:
> >
> > I hope the subject says it all but here's a reiteration.  The sample
> > web.xml in TOMCAT_HOME/doc/appdev shows how to set and access
> > <context-params>.  The current docs on ServletContext do not seem to
> > have a method to get context params.  <init-params> on a per servlet
> > basis work as described but I have several values that all servlets must
> > access.
>
> e.g. in TC3.x core/BaseInterceptor.java implementation
>
>     public void contextInit(Context ctx) throws TomcatException
>     {
> ...
>         String className = ctx.getInitParameter("RoleMapper");
> ...
>     }
>
> Would get the following param from webapps/xx/WEB-INF/web.xml
>
>   <context-param>
>     <param-name>RoleMapper</param-name>
>     <param-value>
>         com.teamware.phoenix.security.auth.TomcatFixedRoleMapper
>     </param-value>
>   </context-param>
>
> Antony


Mime
View raw message