Re: Tomcat: Get absolute path to servlet
From: Wendy S (wendywds_at_hotmail.com)
Date: 12/12/03
- Previous message: dablick: "Set default to 'expanded" for newly inserted JTree nodes"
- In reply to: Paul: "Tomcat: Get absolute path to servlet"
- Next in thread: Paul: "Re: Tomcat: Get absolute path to servlet"
- Reply: Paul: "Re: Tomcat: Get absolute path to servlet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Dec 2003 14:24:09 -0700
"Paul" <paulsmith5@hotmail.com> wrote:
> How do you refer to the servlet in the form of a url as is required.
Look in the web.xml file, there should be one or more <servlet> and
<servlet-mapping> sections. Those tell Tomcat what Servlets to call when
different URLs are used.
<servlet>
<servlet-name>pdf</servlet-name>
<servlet-class>edu.asu.vpia.webapp.PDFServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>pdf</servlet-name>
<url-pattern>/pdf</url-pattern>
</servlet-mapping>
What this says is: when you get a request that ends in /pdf, execute the
Servlet named 'pdf', which is contained in the
edu.asu.vpia.webapp.PDFServlet class.
In your example, it might be /MyServlet (so you'd use
http://localhost:8080/MyServlet ) but it could be anything... only web.xml
(or the documentation) can tell you.
If you're stuck, post or email the web.xml and someone can help figure it
out.
-- Wendy in Chandler, AZ
- Previous message: dablick: "Set default to 'expanded" for newly inserted JTree nodes"
- In reply to: Paul: "Tomcat: Get absolute path to servlet"
- Next in thread: Paul: "Re: Tomcat: Get absolute path to servlet"
- Reply: Paul: "Re: Tomcat: Get absolute path to servlet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|