Re: Tomcat: Get absolute path to servlet

From: Wendy S (wendywds_at_hotmail.com)
Date: 12/12/03

  • Next message: x2: "MultipleParentException need help"
    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
    

  • Next message: x2: "MultipleParentException need help"

    Relevant Pages

    • Re: Split group?
      ... There are very few ME posts ... If the cause turns out to be deeply entwined with networking/EJBs/whatever, then refer them to the other group. ... Anyone who writes something like that is clearly too stupid ever to succeed at programming anything serious in Java, and whoever hired them to work on a business servlet ought to be fired too. ... It would mean the number of groups can't actually decrease, only increase, and will increase if new group names come into use, and under PofN's pet theory people will frequently crosspost to all of them at once, and the more there are ... ...
      (comp.lang.java.programmer)
    • Re: Rotating Log without stop server process
      ... Paul Sure wrote: ... >>I don't mind losing come of the log information. ... >>truncation using ... Only why is stopping the servlet. ...
      (comp.sys.hp.hpux)
    • Re: Tomcat: Get absolute path to servlet
      ... Paul" wrote ... > web.xml above accompanied the servlet ... Leave the default web.xml alone unless you have a specific reason to change ... 80 & 443) and then don't touch the rest of the standard config files. ...
      (comp.lang.java.help)