public void setLastName (String lname){ this.lastName = lname; } public String getFirstName(){ return firstName; } public void setFirstName (String firstName){ this.firstName = firstName; } } and this is the jsp; <%@ page language="java" contentType="text/html" %> <html> <head><title>JSP Page</title></head> <body> <H1>this is a text </H1> <jsp:useBean id="input" class="User" /> <% input.setLastName("AA"); %> <%--<jsp:getProperty name="user" property="getFirstName()" />--%> </body> </html> I was able to compile it if i move it under the examples directory in Tomcat, but i don't want it there. I'm also using NetBeans as an IDE. Any help would be appreciated.