You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pi...@dfki.uni-kl.de on 2008/01/23 12:23:46 UTC

Subclass of Servlet: Inherited method is not visible

Hi,

The following schematically describes my setup. Basically, there are two
servlets, one being a subclass of the other:

public class ServletA extends ParameterMethodResolvingServlet {
  public void init() { ... }
  public void methodA() { ... }
}

public class ServletB extends ServletA {
  public void init() {
    super.init();
    ...
  }
}


The web.xml contains a mapping to ServletB. When I issue an ajax request
to that servlet calling methodA(), the following error occurs:

  HTTP ERROR: 501 No such method: methodA


But everything runs fine when I change ServletB to:

public class ServletB extends ServletA {
  public void init() {
    super.init();
    ...
  }
  public void methodA() {
    super.methodA();
  }
}


Since it is inherited, I expect Tomcat to actually "see" methodA() without
the workaround as shown above.

I am using Tomcat 5.5.25 and Java 1.6.0_03

Any help will be appreciated.
Paul Pichota


-----------------------------------------
This email was sent using SquirrelMail.
   "Webmail for nuts!"
http://squirrelmail.org/


---------------------------------------------------------------------
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: Subclass of Servlet: Inherited method is not visible

Posted by pi...@dfki.uni-kl.de.
Urgh, should have seen that. This explains everything.
Thanks.

> You should ask the implementors of ParameterMethodResolvingServlet
> (according to Google this seems to a project within dfki), or look at
> it's implementation.
>
> -----Original Message-----
> From: pichota@dfki.uni-kl.de [mailto:pichota@dfki.uni-kl.de]
> Sent: Wednesday, January 23, 2008 12:24 PM
> To: users@tomcat.apache.org
> Subject: Subclass of Servlet: Inherited method is not visible
>
> Hi,
>
> The following schematically describes my setup. Basically, there are two
> servlets, one being a subclass of the other:
>
> public class ServletA extends ParameterMethodResolvingServlet {
>   public void init() { ... }
>   public void methodA() { ... }
> }
>
> public class ServletB extends ServletA {
>   public void init() {
>     super.init();
>     ...
>   }
> }
>
>
> The web.xml contains a mapping to ServletB. When I issue an ajax request
> to that servlet calling methodA(), the following error occurs:
>
>   HTTP ERROR: 501 No such method: methodA
>
>
> But everything runs fine when I change ServletB to:
>
> public class ServletB extends ServletA {
>   public void init() {
>     super.init();
>     ...
>   }
>   public void methodA() {
>     super.methodA();
>   }
> }
>
>
> Since it is inherited, I expect Tomcat to actually "see" methodA()
> without
> the workaround as shown above.
>
> I am using Tomcat 5.5.25 and Java 1.6.0_03
>
> Any help will be appreciated.
> Paul Pichota
>
>
> -----------------------------------------
> This email was sent using SquirrelMail.
>    "Webmail for nuts!"
> http://squirrelmail.org/
>
>
> ---------------------------------------------------------------------
> 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
>
>
> ---------------------------------------------------------------------
> 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
>
>
>



-----------------------------------------
This email was sent using SquirrelMail.
   "Webmail for nuts!"
http://squirrelmail.org/


---------------------------------------------------------------------
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: Subclass of Servlet: Inherited method is not visible

Posted by "Reich, Matthias" <ma...@siemens.com>.
You should ask the implementors of ParameterMethodResolvingServlet
(according to Google this seems to a project within dfki), or look at
it's implementation.

-----Original Message-----
From: pichota@dfki.uni-kl.de [mailto:pichota@dfki.uni-kl.de] 
Sent: Wednesday, January 23, 2008 12:24 PM
To: users@tomcat.apache.org
Subject: Subclass of Servlet: Inherited method is not visible

Hi,

The following schematically describes my setup. Basically, there are two
servlets, one being a subclass of the other:

public class ServletA extends ParameterMethodResolvingServlet {
  public void init() { ... }
  public void methodA() { ... }
}

public class ServletB extends ServletA {
  public void init() {
    super.init();
    ...
  }
}


The web.xml contains a mapping to ServletB. When I issue an ajax request
to that servlet calling methodA(), the following error occurs:

  HTTP ERROR: 501 No such method: methodA


But everything runs fine when I change ServletB to:

public class ServletB extends ServletA {
  public void init() {
    super.init();
    ...
  }
  public void methodA() {
    super.methodA();
  }
}


Since it is inherited, I expect Tomcat to actually "see" methodA()
without
the workaround as shown above.

I am using Tomcat 5.5.25 and Java 1.6.0_03

Any help will be appreciated.
Paul Pichota


-----------------------------------------
This email was sent using SquirrelMail.
   "Webmail for nuts!"
http://squirrelmail.org/


---------------------------------------------------------------------
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


---------------------------------------------------------------------
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