You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by rk...@cc.gatech.edu on 2005/01/21 20:21:25 UTC
Value for usebean class attribute is invalid
I'm attempting to get a very basic webapp up and running, but can't seem
to overcome this error:
org.apache.jasper.JasperException: /build/begin.jsp(1,1) The value for the
useBean class attribute Question is invalid.
I've made doubly sure that my class, Question, is declared public and has
a public default constructor. The class files themselves are stowed in
the right place, so i'm stuck on what could possibly be wrong. Any help at
all, would be greatly appreciated!
The jsp is as follows:
<jsp:useBean id="question" class="Question" scope="session"/>
<HTML>
<BODY>
<%
//Display the Question
Question q = new Question();
String body = q.getBody();
out.println(body);
%>
</BODY>
</HTML>
The web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>
<welcome-file>
index.html
</welcome-file>
<session-config>
<session-timeout>54</session-timeout>
</session-config>
<servlet>
<servlet-name>Question</servlet-name>
<servlet-class>Question</servlet-class>
</servlet>
</web-app>
And the full error stack listing:
org.apache.jasper.JasperException: /build/begin.jsp(1,1) The value for the
useBean class attribute Question is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3268)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Value for usebean class attribute is invalid
Posted by Mark Thomas <ma...@apache.org>.
Try putting the class in a package.
Mark
rknickm@cc.gatech.edu wrote:
> I'm attempting to get a very basic webapp up and running, but can't seem
> to overcome this error:
>
> org.apache.jasper.JasperException: /build/begin.jsp(1,1) The value for the
> useBean class attribute Question is invalid.
>
> I've made doubly sure that my class, Question, is declared public and has
> a public default constructor. The class files themselves are stowed in
> the right place, so i'm stuck on what could possibly be wrong. Any help at
> all, would be greatly appreciated!
>
> The jsp is as follows:
>
> <jsp:useBean id="question" class="Question" scope="session"/>
> <HTML>
> <BODY>
>
> <%
>
> //Display the Question
> Question q = new Question();
> String body = q.getBody();
> out.println(body);
>
> %>
>
> </BODY>
> </HTML>
>
> The web.xml:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <web-app>
>
> <welcome-file>
> index.html
> </welcome-file>
>
> <session-config>
> <session-timeout>54</session-timeout>
> </session-config>
>
> <servlet>
> <servlet-name>Question</servlet-name>
> <servlet-class>Question</servlet-class>
> </servlet>
>
> </web-app>
>
> And the full error stack listing:
>
> org.apache.jasper.JasperException: /build/begin.jsp(1,1) The value for the
> useBean class attribute Question is invalid.
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
> org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
> org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
> org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
> org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
> org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> org.apache.jasper.compiler.Generator.generate(Generator.java:3268)
> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org