I can not get the below code to work
---------------------------------------
jsp ----
<html>
<head>Second Felipe Bean Page</head>
<body>
<jsp:useBean id="test" class="FelipeBean"/>
<p> Your last name is: <%= request.getParameter( "lname" )%>
</body>
</html>
bean
-------
public class FelipeBean{
String name;
public FelipeBean(){
name = "Felipe";
}
public String getName(){
String firstName = name;
return firstName;
}
}
I keep getting the below error
-------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 4 in the jsp file: /FelipeBean.jsp
Generated
servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\BeanDemo\org\apache\jsp\FelipeBean_jsp.java:45: cannot resolve symbol
symbol : class FelipeBean
location: class org.apache.jsp.FelipeBean_jsp
FelipeBean
test = null;
^
An error occurred at line: 4 in the jsp file: /FelipeBean.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\BeanDemo\org\apache\jsp\FelipeBean_jsp.java:47: cannot resolve symbol
symbol : class FelipeBean
location: class org.apache.jsp.FelipeBean_jsp
test = (FelipeBean) _jspx_page_context.getAttribute("test", PageContext.PAGE_SCOPE);
^
An error occurred at line: 4 in the jsp file: /FelipeBean.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\BeanDemo\org\apache\jsp\FelipeBean_jsp.java:49: cannot resolve symbol
symbol : class FelipeBean
location: class org.apache.jsp.FelipeBean_jsp
test = new FelipeBean();
^
3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802
