• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP can not load class  RSS feed

 
Bob Kimmel
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to do a SQL insert into Oracle 9i using Weblogic as the Web Server.
Here is my code:
HTML
<html>
<body>
CCEVS DB INSERT PAGE
<p>
<form method=post action="Insert2jsp.jsp">
Product Name: <input type=text name=KICKOFF_DATE>
<br>
PROJECT_ID: <input type=text name=PROJECT_ID>
<br>
KICKOFF_DATE: <input type=text name=KICKOFF_DATE>
<br>
<input type=submit>
</form>
----------------------------------------------------------------------
JSP
<html>
<body>
<%@ page language="java" %>
<jsp:useBean id="Insert2Bean" scope="request" class="InsertPackage.Insert2Bean" />
<%
Insert2Bean.setPRODUCT_NAME(request.getParameter("PRODUCT_NAME"));
Insert2Bean.setPROJECT_ID(request.getParameter("PROJECT_ID"));
Insert2Bean.setKICKOFF_DATE(request.getParameter("KICKOFF_DATE"));
Insert2Bean.doInsert();
%>
<p>
You inserted the following record:
<p>
PRODUCT_NAME: <%= Insert2Bean.getPRODUCT_NAME() %>
<br>
PROJECT_ID: <%= Insert2Bean.getPROJECT_ID() %>
<br>
KICKOFF_DATE: <%= Insert2Bean.getKICKOFF_DATE() %>
</body>
</html>
----------------------------------------------------------------------
This is my bean which is located in the WEB-INF/InsertPackage Folder.
package InsertPackage;
import java.lang.*;
import java.sql.*;
import java.io.*;
public class Insert2Bean {
private String dbURL = "jdbc racle:thin:@52796e:1521:ccevs";
private String dbDriver = "oracle.jdbc.driver.OracleDriver";
private Connection dbCon;
String Project_Name = null;
String PROJECT_ID = null;
String KICKOFF_DATE = null;
public Insert2Bean() {
super();
}
public String getProject_Name() {
return this.Project_Name;
}
public String getPROJECT_ID() {
return this.PROJECT_ID;
}
public String getKICKOFF_DATE() {
return this.KICKOFF_DATE;
}
public void setName(String tProject_Name) {
this.Project_Name = tProject_Name;
}
public void setID(String tPROJECT_ID) {
this.PROJECT_ID = tPROJECT_ID;
}
public void setDATE(String tKICKOFF_DATE) {
this.KICKOFF_DATE = tKICKOFF_DATE;
}
public void doInsert() throws ClassNotFoundException, SQLException {
Class.forName(dbDriver);
dbCon = DriverManager.getConnection(dbURL);
Statement s = dbCon.createStatement();
String sql = "INSERT INTO CCEVS_PROJECTS_REGISTRY values ('" + this.Project_Name;
sql = sql + "', '" + this.PROJECT_ID + "', '" + this.KICKOFF_DATE;
sql = sql + "')";
int insertResult = s.executeUpdate(sql);
dbCon.close();
}

}
This is the Error I keep getting:
Parsing of JSP File '/Insert2jsp.jsp' failed:
--------------------------------------------------------------------------------
/Insert2jsp.jsp(12): class 'InsertPackage.Insert2Bean' could not be loaded
probably occurred due to an error in /Insert2jsp.jsp line 12:
<jsp:useBean id="Insert2Bean" scope="request" class="InsertPackage.Insert2Bean" />
--------------------------------------------------------------------------------
Wed Aug 27 11:26:40 EDT 2003
I'm new at this, so any idea why this is not working would be very help.
Thanks,
Bob
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my bean which is located in the WEB-INF/InsertPackage Folder.

Try putting the compiled bean class in
WEB-INF/classes/InsertPackage/
Bill
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!