• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bean Scope

 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am using the foolowoing code
<% { %>
<jsp:useBean id="name" class='java.lang.String' />
<%= name %>
<% } %>
Some guys (Andy)said in discussion that bean is tested outside {}
scope

but when i test it it gives the following exception stack trace
java.lang.NoClassDefFoundError: org/apache/jasper/compiler/Parser
at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:440)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:411)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
at org.apache.tomcat.core.Handler.service(Handler.java:261)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:720)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:194)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
can anyone tell why it gives this exception
 
tony lee
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried this code, and it runs fine. If you want to print a note, please try this:
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.NoClassDefFoundError: org/apache/jasper/compiler/Parser
You have a problem with your Tomcat setup. Try reinstalling it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic