Ok, let me take a slightly different approach.  In your web.xml file
you are specifying some init-params for a particular named servlet.  Its
Tomcat's job that everytime it sees this name that it passes the init-params
from the web.xml file to the init method (this happens everytime the servlet
is created).

        What I believe is happening is that you are not using this named
servlet to access the servlet (you're probably using /servlet/className),
consequently, Tomcat doesn't think that the init-params are for that
servlet.  Then in your init method you are overwritting the static
variables, or setting the values for a particular instance.

        To set up the mapping you need to edit your web.xml file.  The spec
has the exact order that things need to go, but you will be adding something
like (and this is me typing, not copying, so check for errors)

<servlet-mapping>
        <servlet-name>MyMappedServlet</servlet-name>
        <url-pattern>/MyMappedServlet</url-pattern>
</servlet-mapping>

to your web.xml file (I believe below everything but mime-type mappings).

        Randy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 9:54 AM
To: [EMAIL PROTECTED]
Subject: RE: deep web.xml problem


-Randy

Thank you for technical direction on deep web.xml problem... I will follow
your lead to get this right... You asked "Does it make sense?" Not all of
it. So I ask the following questions for clarification.

QUESTIONS TO RANDY:

at startup create instance, set init-params correctly
Q1) I understand this to mean that as long as my init() method and web.xml
are ok, it's Tomcat's job to do this. Regardless of whether I
<load-on-startup> or not?

at request, create instance, set init-params to null (not specified
in web.xml), process request.
Q2) I don't know if this means Tomcat sets my init-params to null at
request, or if this is an explanation of the problem I am experiencing? Why
do you say (not specified in web.xml)?

What you need to do is to associted the start up with the mapping.
You do this by using the same servlet name for your servlet-mapping and
init-param tags.
Q3) Which config file has servlet-mapping?  Where/How do I map individual
servlet names in a web-app outside of web.xml?  Or am I missing the
concept?





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

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

Reply via email to