I tried mapping the ROOT context's SnoopServlet in a similar fashion, and it is only called once. There isn't enough information supplied to tell what is differenct in your test case.
Larry > -----Original Message----- > From: Smith, Lawrence T (Lance) [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 9:56 AM > To: Tomcat (E-mail) > Subject: Servlet Mapping -- Servlet getting called twice > > > Please HELP: > I don't know if what I am seeing is standard behavior or > something I am > doing wrong. > > I have the following in my web.xml file: > <servlet-mapping> > <servlet-name>CardServlet</servlet-name> > <url-pattern>/Cards/*</url-pattern> > </servlet-mapping> > > The servlet at this point only writes out a simple hello page > and debug > output of getPathInfo() and getRequestURI() but it will do > some pretty heavy > processing which I don't want done twice. What is happening > is as follows: > > I submit the URL: > /foo/Cards/a/b/aCard.jsp > The servlet debug prints: > pathInfo=>/a/b/aCard.jsp > requestURI=>/foo/Cards/a/b/aCard.jsp > pathInfo=>/a/b/ > requestURI=>/foo/Cards/a/b/ > > I submit the URL: > /foo/Cards/aCard.jsp > The servlet debug prints: > pathInfo=>/aCard.jsp > requestURI=>/foo/Cards/aCard.jsp > pathInfo=>/ > requestURI=>/foo/Cards/ > > What I thought should happen is that I would only get called > once. Is what I > am seeing the proper behavior or am I doing something wrong? > Help. The first > time the servlet gets called with what I would expect the > second call is > really throwing me for a loop. > Thanks for any help given. > >
