tomcat-users mailing list archives

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


> I `m calling a bean  from a jsp page that return HttpServletRequest
snippet
>  
> 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()
>Ljavax/servlet/http/HttpServletRequest;
>java.lang.NoSuchMethodError: com.MyBean.getMessage()
>Ljavax/servlet/http/HttpServletRequest;

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:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NoSuchMethodError.html
. 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
anyway.

Regards,
Fredrik

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


Mime
View raw message