You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve R Burrus <bu...@yahoo.com> on 2003/01/17 07:49:00 UTC

What about the Context tag?

 Hello there, newbie finds himself in some need of help with using the <Context>
tag!! I happen to have a server-side Java programming book that tells the reader
to edit this tag in the server.xml file with the specific context path for the
servlet to be seen in the browser, HOWEVER I have noticed that some in this group
have said that this whole file should just be left alone, that Tomcat could
somehow "magically" find the correct path for the servlet! Who is right about this
anyway?!   

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: What about the Context tag?

Posted by Jacob Kjome <ho...@visi.com>.
Hello Steve,

It is fine to edit server.xml, but it might be easier to use a Context
Configuration File.  See the current webapps directory in any recent
Tomcat release such as 4.1.8.  Notice the admin.xml and manager.xml
files?  Just make a [myapp].xml file and add your <Context ...> tag
with all nested tags needed to it.  Write the path as whatever context
path you want to access your app (eg... path="/myapp").  Then, for the
docBase, use the directory or .war file that your app is being
deployed from.  For instance docBase="myapp" or docBase="myapp.war".
The latter case will force the app to be served directly from the .war
file where the former case forces it to be served from the directory.

Stop Tomcat, put both your [myapp].xml file and the .war or directory structure of
your app in webapps, and start Tomcat.  Everything should work fine.

Jake

Friday, January 17, 2003, 12:49:00 AM, you wrote:

SRB>  Hello there, newbie finds himself in some need of help with using the <Context>
SRB> tag!! I happen to have a server-side Java programming book that tells the reader
SRB> to edit this tag in the server.xml file with the specific context path for the
SRB> servlet to be seen in the browser, HOWEVER I have noticed that some in this group
SRB> have said that this whole file should just be left alone, that Tomcat could
SRB> somehow "magically" find the correct path for the servlet! Who is right about this
SRB> anyway?!   

SRB> __________________________________________________
SRB> Do you Yahoo!?
SRB> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
SRB> http://mailplus.yahoo.com

SRB> --
SRB> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
SRB> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: What about the Context tag?

Posted by "Noel J. Bergman" <no...@devtech.com>.
Steve,

The <context> tag defines the context for the entire web application, not
each servlet.  I gave you a single ZIP file containing your sample web app.
If you install tomcat *AND* you can use tomcat's sample servlets as
delivered, then you should be able to use what I gave you.  The one I gave
you uses a separate .XML, just as the admin and manager web apps.

However, until you can run tomcat by itself with no other changes, nothing
anyone does is going to help you.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>