tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fredrik Rubensson" <>
Subject RE: error Ljavax/servlet/http/HttpServletRequest
Date Wed, 11 Jan 2006 09:47:12 GMT

> I `m calling a bean  from a jsp page that return HttpServletRequest
> HttpServletRequest req= myBean.getMessage();
>   out.write(req.getParameter("mess"));
>   where mess is a variable that was set in the bean
> My problem jsp can`t compile I got the following errors
>javax.servlet.ServletException: com.MyBean.getMessage()
>java.lang.NoSuchMethodError: com.MyBean.getMessage()

I feel this question should be answered by reading up on Java - it has
not much to do with tomcat. The exception you get is easy to find on the
web I googled "java.lang.NoSuchMethodError" and got as first result the
Sun javadoc for the class. It's here:
. It says: "Thrown if an application tries to call a specified method of
a class (either static or instance), and that class no longer has a
definition of that method." (Now this explanation may be hard to
understand if you are not somewhat used to OO terminology. If this is
the case I suggest you read up on OO and its use in Java.) Anyway, this
means that there is no method in your class com.MyBean called getMessage
that returns an instance of javax.servlet.http.HttpServletRequest. 

It would be interesting to know why you are passing around the
HttpServletRequest in this way. It is easily accesible from the JSP page


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

View raw message