*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Error - Please Help!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Error - Please Help!!!" Watch "Error - Please Help!!!" New topic
Author

Error - Please Help!!!

Ramesh Bandaru
Greenhorn

Joined: Sep 17, 2003
Posts: 5
Hello,
I am writing a JSP file using a JavaBeans class.But when I try to complile it I get the following error.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /StringBean.jsp(9,0) jsp.error.useBean.badScope
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:140)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:420)
at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:592)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1070)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1076)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:232)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
at org.apache.jasper.compiler.Validator.validate(Validator.java:607)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:230)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)
I am also including both my JSP file and Java Beans class file.
JSP File
<html>
<head>
<title>Using JavaBeans With JSP</title>
</head>
<body>
<center><h2><b>Using JavaBeans With JSP</b></h2></center>
<%@ page language ="java" import="beans.*" %>
<jsp:useBean id="stringBean" scope="message" class="beans.StringBean" />
<ol>
<li>Initial Value(getProperty) :
<i><jsp:getProperty name="stringBean" property="message" /></i>

<li>Initial Value(JSP Expression) :
<i><%= stringBean.getMessage( ) %></i>
<li><jsp:setProperty name="stringBean" property="message"
value="Best string bean: Fortex" />
<li> Value after setting property with settingProperty :
<i><jsp:getProperty name="stringBean" property="message" /></i>
<li><% stringBean.setMessage("My favorite : Kentucky Wonder"); %>
Value after setting property with scriplet :
<i><%= stringBean.getMessage( ) %></i>
</ol>
</body>
</html>
And my java beans class file is
package beans;

public class StringBean {
private String message = "No message specified";

public String getMessage( ) {
return(message);
}
public void setMessage(String message) {
this.message = message;

}
}

I am using Tomcat 4.1.27.And I put beans class in C:Tomcat4jakarta-tomcat-4.1.27-LE-jdk14webappsROOTWEB-INFclasses which is where I store all my servlet classes and beans is my package directory for beans class.
I would appreciate any help.


Ramesh
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Scope is wrong, look at what is valid:
<jsp:useBean id="name" scope="page|request|session|application" typeSpec />


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Ramesh Bandaru
Greenhorn

Joined: Sep 17, 2003
Posts: 5
Got it.Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error - Please Help!!!
 
Similar Threads
Do Not Understand "/tags/struts-logic" Not Found
struts framework
Invalid buffer size
Problem with simple bean that fails only at deployment location
Including Servlets to JSP page