tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Accessing Servlets In Packages
Date Thu, 16 Nov 2000 19:41:09 GMT
JTBldrCO@aol.com wrote:

> [snip]
> Now, take a class, SomePackageClass, declared to be in package testapackage
> within its .java code file.  Its compiled form is in the following file:
>
> /usr/local/jakarta-tomcat/webapps/myWebApp/WEB-INF/classes/testapackage/SomePa
>
> ckageClass.class
>
> I would like to (but CANNOT) access it with:
>
> http://www.mySiteName.com/myWebApp/servlet/testapackage/SomePackageClass
>

Why can't you use a servlet definition and mapping like this:

    <servlet>
        <servlet-name>My Servlet</servlet-name>
        <servlet-class>testpackage.SomePackageClass</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>My Servlet</servlet-name>
        <url-pattern>/servlet/testpackage/SomePackageClass</url-pattern>
    </servlet-mapping>

which would support your desired URL?

>
> John Thompson
> Boulder, Colorado, USA
> JTBldrCO@aol.com

Craig McClanahan



Mime
View raw message