tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How do I debug dispatching errors?
Date Tue, 27 Oct 2009 19:58:28 GMT
Hash: SHA1


On 10/20/2009 12:50 PM, Josh wrote:
> I have a debug statement set on the first line in the constructor of
> com.mycorp.referral.servlets.CreateRelationshipServlet.  However, when I
> call the servlet with this URL: 
> http://localhost:8081/MyApp/CreateRelationshp ... the createRelationship
> is not called - rather, ProcessAction is called again.

How are you determining that CreateRelationship is called? If you have a
log statement in the constructor for your servlet, then it ought to only
be called once: when the servlet is instantiated a single time by the
container. That instance will be used to service all requests that map
to that servlet.

Perhaps you should put a log statement in the service() method (or
doGet, doPost, etc.) and see what you get, there.

> I have set the
> debug levels in server.xml and web.xml to 'DEBUG'...

AFAIK, there are no Tomcat-related "debug levels" to be set in either
server.xml or web.xml unless you are using an unsupported version of Tomcat.

>    <servlet>
>            <servlet-name>CreateRelationshipServlet</servlet-name>
> <servlet-class>com.mycorp.referral.servlets.CreateRelationshipServlet</servlet-class>
>    </servlet>
>    <servlet>
>            <servlet-name>ProcessActionServlet</servlet-name>
> <servlet-class>com.mycorp.referral.servlets.ProcessActionServlet</servlet-class>
>    </servlet>


>    <servlet-mapping>
>            <servlet-name>CreateRelationshipServlet</servlet-name>
>            <url-pattern>/CreateRelationship</url-pattern>
>    </servlet-mapping>
>    <servlet-mapping>
>            <servlet-name>ProcessActionServlet</servlet-name>
>            <url-pattern>/ProcessAction</url-pattern>
>    </servlet-mapping>

The above looks just fine. Are you forwarding the user from
CreateRelationshipServlet to ProcessActionServlet instead of redirecting
them, and getting confused about the appearance of the URL?

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message