tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Carr <pc...@infinitemarket.com>
Subject Re: How do I map my servlets into the web-application
Date Wed, 22 Mar 2000 15:55:47 GMT
You need to change the docBase attribute in the Context tag.

Assuming the following directory structure
${TOMCAT_HOME}/QuickTrade/htdocs
Use the following in server.xml
<Context path="/QuickTrade docBase="/QuickTrade/htdocs" reloadable="true">

Of course I recommend the following which works for me.
${TOMCAT_HOME}/webapps/QuickTrade
    put all of your stuff, such as WEB-INF folder inside of the QuickTrade folder
<Context path="QuickTrade" docBase="webapps/QuickTrade" reloadable="true">



Boris Prochazka wrote:

> How do I map my servlets into the web-application
>
> I want to acheive so my servlet will appeare under <contextPath>/<servlet-name>
>
> Following situation:
>
> - The web-applications is defined in server.xml with:
>         <Context path="/QuickTrade" docBase="QuickTrade/htdocs"
> reloadable="true" >
>         </Context>
>
> - My servlet is in the package qbo with file name
>   QBO_LdapProfileServlet.class and package name qbo
>
> - The classe files are all places in QuickTrade/WEB-INF/classes/qbo/*.class
>
> - The web.xml is updated with
>
>     <servlet>
>         <servlet-name>
>             supplierReg
>         </servlet-name>
>         <servlet-class>
>             qbo.QBO_LdapProfileServlet
>         </servlet-class>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>
>             supplierReg
>         </servlet-name>
>         <url-pattern>
>             /supplierReg
>         </url-pattern>
>     </servlet-mapping>
>
>     As you note I would like the servlet to appear under /QuickTrade/supplierReg
>
> I can access the servlet with the url
> /QuickTrade/servlet/qbo.QBO_LdapProfileServlet but that wont do. I use
> the same servlet for a number of different services. I select the
> service depending of the servlet url (alias/servletname).
>
> I am using tomcat 3.1b1, JDK 1.2.2_05 on Solaris 7
>

Mime
View raw message