tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David J. Ferrero" <david.ferr...@zion.com>
Subject Re: global parameters
Date Fri, 04 Aug 2000 16:11:41 GMT
Ok, I posted a question earlier about init parameters for JSPs but
haven't seen any replys but this thread is close enough that maybe I can
learn of a solution.

I followed a MVC design pattern and have a Main.jsp which creates a
Controller object which creates beans. How can I use <context-param> for
Main.jsp in web.xml? I mean, it's a JSP not a servlet so I don't
normally put servlet info in the web.xml about Main.jsp...

Thanks for any clarity.

- David

Re: global parameters
Date: Thu, 03 Aug 2000 09:38:18 -0700
From: "Craig R. McClanahan" <Craig.McClanahan@eng.sun.com>
To:  tomcat-user@jakarta.apache.org

Rene Duettra wrote:

> Hi,
> Normally I use web.xml to define parameters for servlets.
> Now I need to define some which should apply to all servlets.
> I think there is an easier way than defining all parameters
> for each servlet in the web.xml ...
>

The easiest way to do this is to use context initialization parameters,
rather than servlet initialization parameters.  I don't have the Servlet
2.2 spec in front of me, but it's probably <context-param> or something
like that.

In the servlet, you retrieve such a parameter like this:

    String paramValue =
      getServletContext().getInitParameter("paramName");

>
> Thanks for answers.
>
> Rene

Craig McClanahan


-- 
==========================================================
ZION SOFTWARE, LLC                     http://www.zion.com
==========================================================

Mime
View raw message