I use apache-tomcat-6.0.13 and I'm trying to use Beans in my jsp page
, but unfortunately I got this error:
An error occurred at line: 23 in the jsp file: /index.jsp
NewBean cannot be resolved to a type
here is my jsp page:
jsp:useBean id="theBean" class="NewBean" />
<p><%
int j = theBean.doubleIt(3);
out.println("j is: "+j); %></p>
and here is my simple bean class:
public class NewBean {
public int doubleIt(int number) {
return 2 * number;
}
}
I should tell that I have compiled the bean class and placed it into
WEB-INF\classes directory .
I dont know whether I shoukld add somthing in web.xml or not.