tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carey Parker <cpar...@longboard.com>
Subject RE: init parameters and ServletConfig
Date Mon, 29 Oct 2001 15:56:30 GMT
Never got an answer on this - can someone clear this up for me?


-----Original Message-----
From: Carey Parker [mailto:cparker@longboard.com]
Sent: Saturday, October 27, 2001 9:51 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: init parameters and ServletConfig


I'm creating a simple servlet engine, and I'm confused about which init
parameters are made available via the ServletConfig object.

In the DTD for web.xml, there are two sets of parameters: context-param and
init-param.  The context-param's are in the web-app scope and the
init-params are in the servlet element scope.

So, when the servlet engine invokes the init() method on the servlet with a
ServletConfig object, and the servlet invokes
ServletConfig.getParameterNames(), which parameters does it see?

Let's say we have the following web.xml snippet...

<web-app>
<context-param>foo</context-param>
<servlet>
   <servlet-name>boo1</servlet-name>
   <init-param>foo1</init-param>
</servlet>
<servlet>
   <servlet-name>boo2</servlet-name>
   <init-param>foo2</init-param>
</servlet>
</web-app>

So, there are three parameters here: foo, foo1, and foo2.  When servlet boo1
does a ServletConfig.getParameterNames(), does it get...

- just foo1?  
- foo and foo1?
- foo, foo1 and foo2?

Thanks!
Carey

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message