hi everybody. i am chaitanya. i am working on websphere server. i have a serious problem and i am tired. please help me.
my
jsp page is unable to get the bean. i am using eclipse to code the beans and jsps. my folder structure is like this
webcontent(root_folder)
|
|__bean(folder)
| |
| |__SimpleBean.class
|
|__meta-inf(folder)
|
|__web-inf(folder)
|
|__sample.jsp
this is the error i got. please help me.
org.apache.jasper.JasperException: /sample.jsp(10,0) The value for the useBean class attribute bean.SimpleBean 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:3270)
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:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
my jsp page looks like this:
sample.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<jsp:useBean id="test" class="bean.SimpleBean" />---------------------------------------------here lies the error.eclipse is saying bean cannot be resolved to a type
<jsp:setProperty name="test" property="name" value="karthik" />
<jsp:getProperty name="test" property="name" />
</body>
</html>
my bean looks like this.
SimpleBean.java
package bean;
public class SimpleBean implements java.io.Serializable
{
private
String name="";
SimpleBean(){}
public void setName(String name)
{
this.name=name;
}
public String getName(String name)
{
return(name);
}
}