Hey!

I checked the spec. and did not find any words that indicate
that servlet mappings are required.

I did find something in a TomCat FAQ.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* In order to define a name and init params for the newly installed
     servlet you need to also:

  register the servlet with a <servlet> element in the
  WEBAPP/WEB-INF/web.xml file

  you can optionally map your servlet
  to uri requests relative to the context
  within it is located by adding a <servlet-mapping>
element in the WEBAPP/WEB-INF/web.xml
  file
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Notice the words ...you can optionally map your servlet...

Now that's the ground work for my suggestion.

Since sevlet mapping is optional, and you can call the servlet by-name,
like

.../webappname/servlet/servletname


it seems logical to me that by default, one should be able to access
servlet parameter someParam, i.e., getInitParameter().  But this is not
the case.

This may be implementation specific?  I have not tried it with TomCat
though.

...
 <servlet>
<servlet-name>
servletname
      </servlet-name>
<servlet-class>
  MyServletClass
</servlet-class>
<init-param>
<param-name>
someParam
</param-name>
<param-value>
true
</param-value>
</init-param>

<!-- notice that there is no mapping -->

</servlet>
...

By-default, at the very minium one should have
access to the init parameter defined above.

If you need multiple mappings to the same servlet, then obviously
you need to use mapping elements.

I can guess what is happening in the code, but I haven't
looked yet.  Web.xlm gets parsed and if it does not see
a servlet mapping element then it skips the process
for changing the properties file.

I suggest, don't skip this process.

Anyone agree?

Sans adieu,
Danny Rubis

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to