tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: Making document root correspond to a context.
Date Tue, 19 Sep 2000 18:55:37 GMT


> -----Original Message-----
> From:	Haller, Joe [SMTP:Joe.Haller@purchasepro.com]
> Sent:	Tuesday, September 19, 2000 8:13 PM
> To:	'tomcat-user@jakarta.apache.org'
> Subject:	Making document root correspond to a context.
> 
> How do we configure Tomcat so that the document
> root of the web server corresponds to a particular context.
> 
> For example, suppose I have a context foo, with JSP bar.jsp, 
> how do I configure so the following will work:
> 
> http://localhost/bar.jsp
> 
> Many thanks.
> J. Haller
> 
	[Kitching Simon]  
	Assuming you are using tomcat 3.1,
	in the $TOMCAT_HOME/conf/server.xml file, put
	 
	<Context 
	  path="" 
	  docBase="/home/me/mywebapproot" 
	  debug="0" 
	  reloadable="true" >
	 </Context>

	The "path" attribute of the context definition 
	is the prefix to be used when accessing
	your webapp. If the path is empty, then
	files in that webapp are accessable without
	any prefix.

	The docBase is either absolute (as above),
	or relative to the $TOMCAT_HOME directory.

	Of course, "there can be only one" context
	with empty path. And I presume (though
	haven't tried it) that that root context can't
	have any subdirs that match the names of
	other contexts...

	Hope this helps,

	Simon

> -----Original Message-----
> From: Kitching Simon [mailto:Simon.Kitching@orange.ch]
> Sent: Tuesday, September 19, 2000 11:08 AM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: RE: tomat/linux - can't get jsp to work in dir other than
> exampl es!
> 
> 
> 
> 
> > -----Original Message-----
> > From:	Shailendra majmundar [SMTP:smaj@Zambeel.com]
> > Sent:	Tuesday, September 19, 2000 7:39 PM
> > To:	tomcat-user@jakarta.apache.org
> > Subject:	tomat/linux  - can't get jsp to work in dir other than
> > examples!
> > 
> > I can access my servlets after configuring server.xml, but the jsps in
> > WEB-INF directory won't work.
> > Is there some magic to apache conf that I am missing? I don't see any
> jsp
> > related tags in
> > $TOMCAT_HOME/..examples/WEB-INF/web.xml.
> >  
> > It seems to work only in the examples directory. 
> >  
> > Thanks
> > 
> 	[Kitching Simon]  
> 	Hi,
> 
> 	I don't know if the above is just a typo, but 
> 	just in case it isn't, I'll point out:
> 
> 	jsp files do *not* go in the WEB-INF subdirectory of your
> 	web application's main (root) directory. They go anywhere
> 	you like under your web application's main directory
> 	*except* under WEB-INF.
> 
> 	Servlet classes *do* go in the WEB-INF/classes subdirectory
> 	of your web application's main (root) directory.
> 
> 	And you need to configure apache so that tomcat is invoked
> 	for any URl which:
> 	(a) ends in .jsp, or
> 	(b) matches one of your servlets
> 
> 	It is always recommended that you get things working with
> 	tomcat in "stand-alone" mode, ie without apache, then try
> 	adding apache as a front-end afterwards.
> 
> 	You don't need to put any entries in yourwebapp/WEB-INF/web.xml
> 	related to your jsp files, unless you are trying something really
> tricky
> 	like running a page's init function on startup.
> 
> 	Regards,
> 
> 	Simon

Mime
View raw message