we are getting compilation error in importing the
java bean.
is there any error in the path we specified.
we got these errors
-----------------------------------------------------------------
org.apache.jasper.JasperException: Unable to compile class for
JSP at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:500)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:150)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:195)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
----------------------------------------------------------------------
structure of directory is
webapps/ch03/welcome.jsp
web-inf/classes/ch03/Bean1.class
---------------------------------------------------------------
jsp file
---------------------------------------------------------------
<jsp:UseBean id="bean1" scope="request" class="Bean1">
</jsp:UseBean>
<jsp:setProperty name="bean1" property="*" />
<html>
<head>
<title>java welcome page </title>
</head>
<body>
<h1>jsp welcome page</h1>
<b>Name :</b><% =bean1.getName() %><br>
<b>AGe: </b><% =bean1.getAge() %><br>
</body>
</html>
Java Bean
--------------------------------------------------------------------
package ch03;
public class Bean1
{
private
String name=null;
private String age=null;
public Bean1()
{
}
public String getName()
{
return name;
}
public void setName(String n)
{
name=n;
}
public String getAge()
9{
return age;
}
public void setAge(String ag)
{
age=ag;
}
}