<jsp:useBean id="person" class="Employee" type="Person" scope="session" > <jsp:setProperty name="person" property="name" value="ABCD" /> </jsp:useBean> The above usage is giving the following error.
An error occurred at line: 1 in the jsp file: /empInput.jsp Generated servlet error: Person cannot be resolved to a type --------------------------------- Person.java: public interface Person {
} ---------------------------------- Employee.java: public class Employee implements Person { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
Why the error message.
nitin pai
Ranch Hand
Joined: May 30, 2006
Posts: 185
posted
0
Hi Sunder,
I tried out the example you posted. The code is proper and I did get the same error but when I put these classes inside packages it ran without any error.
So try putting the Person and Employee inside packages and check.