tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob S." <>
Subject Re: FW: Error when reading a servlet
Date Thu, 01 Jan 1970 00:00:00 GMT
> I have given something like this within my server.xml file
> <Context path="/health"
> docBase="/jakarta-tomcat-3.2.1/webapps/com/health/wls/servlets"
> crossContext="true" debug="0" reloadable="true"></Context>

The "docBase" is the root of your web application, where there will be a WEB-INF subdirectory.

> -> here the main reason why i have given docBase="/jaka......" is coz if I
> give in as docBase="/webapps/com...." I get a error something like this
>  What I want you to note is it's looking for files within c:/webapps... but
> actually I have dir structure as c:/jakara-tomcat-3.2.1/webapps....

Right, because you're specifying the docBase as "/webapps" so of course it will look for files
in C:/webapps =)
> ->Please tell me if I give in docbase as "webapps/health" how will it know
> the exact servlets path... which is within webapps/com/health/wls/servlets

It knows because the web.xml knows to look for class files in WEB-INF/lib and WEB-INF/classes.
 You should place your servlet class in WEB-INF/classes under your docBase.
> Now in the my url address if I give ~localhost:8080/health/HealthLogin it
> gives me a error saying page cannot be found.

As far as I know "~localhost" isn't the same as "localhost".  This will definitely be a problem.
 It is on my Win2k machine.

Have you read anything about servlets and web applications yet?  Head to
and click on the appropriate documentation bundle for whatever version of Tomcat you're using.

- r

View raw message