Tomcat, Beans and JSP
Hi,
I have written a simple bean called UserProfile as shown below, and have compiled and copied the class file into my classes folder in WEB-INF in webapps. i.e.
/tomcat folder/webapps/myfolder/WEB-INF/classes/
TomCat has then be restarted and as part of my JSP called Individual.jsp, i have the following:
<jsp:usebean id="user" class="UserProfile" scope="session"/>
However, when i try and view Individual.jsp, I receive the following error:
org.apache.jasper.JasperException: /actions/DoLogin.jsp(3,5) Invalid standard action
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Any help on this matter would be greatly appreciated.
Thanks in advance
Stuart
<UserProfile.java>
import java.io.*;
/**
*
* Class to represent an executive officer
* @author Stuart Ross
* @version 1.0 05/02/2007
*/
public class UserProfile { //start class
//define instance variables
private int pk;
private String firstName;
private String lastName;
private String status;
/**
* Method to get the primary key of an officer
*
* @return pk primary key of the officer
*/
public int getPK() {
return pk;
}
/**
* Method to get the first name of an officer
*
* @return firstName first name of the officer
*/
public String getFirstName() {
return firstName;
}
/**
* Method to get the last name of an officer
*
* @return lastName last name of the officer
*/
public String getLastName() {
return lastName;
}
/**
* Method to get the status of an officer
*
* @return status status of the officer
*/
public String getStatus() {
return status;
}
/**
* Method to set the primary key of an officer
*
* @param pkey primary key of the officer
*/
public void setPK(int pkey) {
pk = pkey;
}
/**
* Method to set the first name of an officer
*
* @param fname first name of the officer
*/
public void setFirstName(String fname) {
firstName = fname;
}
/**
* Method to set the last name of an officer
*
* @param sname last name of the officer
*/
public void setLastName (String sname) {
lastName = sname;
}
/**
* Method to set the status of an officer
*
* @param stat status of the officer
*/
public void setStatus (String stat) {
status = stat;
}
} //end class

