You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Druzhiinin Mihail <md...@rcbd.org> on 2008/09/29 13:11:45 UTC

Servlet url mapping work incorrect when many servlets have one code

Dear users,

We have 2 servlets with one code and different init parameters mapped to
different url. On high load requests to first servlet handled by second servlet. I different servlets by init params. It apparent when second servlet was called.
What I do illegal?

web.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

   

    <security-role>
        <role-name>ybs</role-name>
    </security-role>

    <servlet>
    	<description>Main servlet</description>
    	<display-name>YellowBoxServlet</display-name>
    	<servlet-name>YellowBoxServlet</servlet-name>
    	<servlet-class>rcbd.nbilling.yb.YellowBoxServlet</servlet-class>
        <init-param>
            <description>Идентификатор оператора, от которого будет осуществляться прием платежей</description>
            <param-name>operator_id</param-name>
            <param-value>9000</param-value>
        </init-param>
        <run-as>
            <role-name>ybs</role-name>
        </run-as>
    </servlet>
    
    
   
    <servlet>
    	<description>4Play servlet</description>
    	<display-name>YellowBoxServlet_PS</display-name>
    	<servlet-name>YellowBoxServlet_PS</servlet-name>
    	<servlet-class>rcbd.nbilling.yb.YellowBoxServlet</servlet-class>
        <init-param>
            <description>Идентификатор оператора, от которого будет осуществляться прием платежей</description>
            <param-name>operator_id</param-name>
            <param-value>9001</param-value>
        </init-param>
        <run-as>
            <role-name>ybs</role-name>
        </run-as>
    </servlet>
        
    <servlet-mapping>
    	<servlet-name>YellowBoxServlet</servlet-name>
    	<url-pattern>/ybs</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
    	<servlet-name>YellowBoxServlet_PS</servlet-name>
    	<url-pattern>/ps</url-pattern>
    </servlet-mapping>
</web-app>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Servlet url mapping work incorrect when many servlets have one code

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mihail,

Druzhiinin Mihail wrote:
> We have 2 servlets with one code and different init parameters mapped to
> different url.

So, you mean to say that you have a single servlet deployed on two
different URL patterns.

> On high load requests to first servlet handled by second
> servlet.

This is highly unlikely. What is the behavior you are actually observing?

> I [configure] different servlets by init params. It apparent when second
> servlet was called.

What is the symptom?

> What I do illegal?

Your web.xml looks just fine. Could you post some of the code? I suspect
this is a data-sharing issue, and not a Tomcat problem. Do you use any
non-final static members in your servlet class?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjqSLgACgkQ9CaO5/Lv0PAMfgCeLfFRhpRUj2EKiusdTYwf3Se/
OSwAn3pOrEZG6rSw2OWPAnVoCGFU29MS
=pf3w
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org