On Fri, 9 Mar 2001, Markus Keller [OrcaSoft] wrote:

> Hello Milt
> 
> > > The value of init parameter var1 is:
> > > <%=
> > >     getServletConfig().getInitParameter("var1")
> > > %>
> > > </P>
> 
> I use this:
> 
> <title><%= getServletContext().getInitParameter("ApplicationName") %>
> 
> instead of getServletConfig() and it works.

Well, they're not really interchangable, they're meant for different
purposes.  Basically, according to the 2.2 spec, there are context
parameters, and servlet parameters.  A context is basically a web
application, so context parameters are intended to be use for
application-wide parameters.  Servlet parameters are only for a
specific servlet (i.e. a subset of the application).

Sure, you can avoid using servlet parameters, and only use context
parameters, but whether that's the most appropriate and/or cleanest
way to do things depends on what you're doing.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to