If you change the context path as described below by Yoav, you must also
change the existing servlet mapping...

<servlet-mapping>
    <servlet-name>HelloWorldServlet</servlet-name>
    <url-pattern>/mywebapp/HelloWorld</url-pattern>
</servlet-mapping>

I think that the real question here should be...  Why are you trying to do
this?  Can you not simply access the servlet via /mywebapp/HelloWorld?

Sean Dockery
[EMAIL PROTECTED]
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com

----- Original Message -----
From: "Shapira, Yoav" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, February 14, 2003 07:14
Subject: RE: Context/mapping question




This desire requires being on the root context (the one with context
path "" as opposed to "mywebapp").  Therefore, you WILL need to put an
explicity context element in your server.xml, which includes:
<Context docBase="mywebapp.war" path="" ...>

Moreover, within your web.xml, you will need to add one more
servlet-mapping:
<servlet-mapping>
  <servlet-name>HelloWorldServlet</servlet-name>
  <url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping>

Personally, I don't like having more than one servlet-mapping per
servlet, but that's just my preference.  The standard allows many
mappings and tomcat allows many mappings without a problem.

I hope this helps,

Yoav Shapira
Millennium ChemInformatics



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


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




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

Reply via email to