New here. Just read through posts concerning Exceptions creating bean of class and couldn't find my answer.
I'm using a book, which is outdated but I didn't realize it. However, I thought I'd try to get through it anyways.
The exception is as follows:
javax.servlet.ServletException: Exception creating bean of class LookupForm: java.lang.ClassNotFoundException: LookupForm
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:495)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:101)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
I am using
Tomcat 4.1.31 and j2sdk1.4.2.
The struts-config.xml file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD
Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="lookupForm"
type="ch3.LookupForm"/>
</form-beans>
<action-mappings>
<action
path="/Lookup"
type="ch3.LookupAction"
name="lookupForm">
<forward name="success" path="/quote.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
</action-mappings>
</struts-config>
The LookupForm.java file:
package ch3;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class LookupForm extends ActionForm
{
private
String symbol = null;
public String getSymbol()
{
return symbol;
}
public void setSymbol(String symbol)
{
this.symbol = symbol;
}
public void reset(ActionMapping mapping,
HttpServletRequest request)
{
this.symbol = null;
}
}
The index.jsp file:
<%@ page language="java" %>
<%@ include file="/WEB-INF/jsp/TagLibraryHeader.jsp" %>
<html>
<head>
<title>Wrox Struts Application</title>
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td height="68" width="48%">
<div align="left">
<img src="images/newwroxlogo.gif"
</div>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<html:form action="Lookup">
<table width="45%" border="0">
<tr>
<td>Symbol:</td>
<td><html:text property="symbol" /></td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit /></td>
</tr>
</table>
</html:form>
</body>
</html>
The original error I had the errors with the attributes for the <html:form> tag. I removed the attributes in the index.jsp file to be:
<html:form action="Lookup">
This solved one issue, however I get the following exception now. The LookupAction and LookupForm were both compiled and placed into the
...\webapps\ch03app\WEB-INF\classes\ch3
Any help would be appreciated. Thanks!