using javabeans in sevlets
807598Apr 3 2006 — edited Apr 9 2006I am have a bean class and i am trying to create an instance of this class in my servlet using the following code.
HttpSession session = request.getSession();
if(session.isNew())
{
FirstBean sBean = (FirstBean)session.getAttribute("sBean");
if(sBean == null)
{
sBean = new FirstBean();
session.setAttribute("sBean",sBean);
}
so on..
when i compile this servlet it give an error.
java:16: cannot resolve symbol
symbol : class FirstBean
location: class College.Nav_homepage
FirstBean sBean = (FirstBean)session.getAttribute("sBean");
i have class FirstBean(compiled and no errors) in the same package as the servlet. but the servlet is giving compiler error. if i move the servlet out of the folder in which the bean class is. the servlet complies but when i am trying to use this bean in a jsp then i get an error.
pls help.