hi there, i have this error,
javax.servlet.ServletExcep
tion: Exception creating bean of class net.foong.newitemForm: {1}
org.apache.jasper.runtime.
PageContex
tImpl.doHa
ndlePageEx
ception(Pa
geContextI
mpl.java:8
67)
org.apache.jasper.runtime.
PageContex
tImpl.hand
lePageExce
ption(Page
ContextImp
l.java:800
)
org.apache.jsp.pages.newit
emForm_jsp
._jspServi
ce(newitem
Form_jsp.j
ava:80)
org.apache.jasper.runtime.
HttpJspBas
e.service(
HttpJspBas
e.java:133
)
javax
and below is the rest of my struts program.
1. sturts-config.xml
<!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 Bean Definitions -->
<form-beans>
<form-bean name="newitemForm" type="net.foong.newitemFor
m">
</form-bean>
</form-beans>
<!-- ==========================
======= Global Exception Definitions -->
<global-exceptions>
</global-exceptions>
<!-- ==========================
========= Global Forward Definitions -->
<global-forwards>
<forward name="welcome" path="/do/Welcome" />
</global-forwards>
<!-- ==========================
========= Action Mapping Definitions -->
<action-mappings>
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action path="/Welcome" type="org.apache.struts.ac
tions.Forw
ardAction"
parameter="/pages/Welcome.
jsp" />
<action path="/newitemForm" type="org.apache.struts.ac
tions.Forw
ardAction"
parameter="/pages/newitemF
orm.jsp" />
<action path="/newitem" type="net.foong.newitemAct
ion" name="newitemForm" scope="request" validate="false" parameter="/do/newitemForm
.jsp">
<forward name="success" path="/pages/cofirmation.j
sp" />
</action>
</action-mappings>
<!-- ==========================
==========
= Controller Configuration -->
<controller processorClass="org.apache
.struts.ti
les.TilesR
equestProc
essor" />
<!-- ==========================
====== Message Resources Definitions -->
<message-resources parameter="resources.appli
cation" />
<!-- ==========================
==========
=== Plug Ins Configuration -->
<!-- comment following if struts1.0.x -->
<plug-in className="org.apache.stru
ts.tiles.T
ilesPlugin
">
<set-property property="definitions-conf
ig" value="/WEB-INF/tiles-defs
.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-pars
er-validat
e" value="true" />
</plug-in>
<!-- end comment if struts1.0.x -->
<plug-in className="org.apache.stru
ts.validat
or.Validat
orPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-
rules.xml,
/WEB-INF/v
alidation.
xml" />
</plug-in>
</struts-config>
2. my link page whereby will call the <html:link page="/do/newitemform" />
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<html:html locale="true">
<head>
<link href="<html:rewrite page="/pages/rr.css" />" rel="stylesheet" type="text/css">
<title><bean:message key="welcome.title"/></tit
le>
<html:base/>
</head>
<body bgcolor="white">
<logic:notPresent name="org.apache.struts.ac
tion.MESSA
GE" scope="application">
<font color="red">
ERROR: Application resources not loaded -- check servlet container
logs for error messages.
</font>
</logic:notPresent>
<h3><bean:message key="welcome.heading"/></h
3>
<!-- <p><bean:message key="welcome.message"/></p
>
-->
<p><bean:message key="welcome.msg"/></p>
<html:link page="/do/newitemForm">Cre
ate New Item</html:link>
</body>
</html:html>
3. newitemForm.jsp in "/pages/newitemForm.jsp"
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html>
<html:html locale="true">
<head>
<link href="<html:rewrite page="/pages/rr.css" />" rel="stylesheet" type="text/css">
<title><bean:message key="welcome.title"/></tit
le>
<body>
<html:form action="newitem" focus="itemName" >
<table>
<tr>
<td>Item Name : </td>
<td><html:text property="itemName" /></td>
</tr>
<tr>
<td>Quantity</td>
<td><html:text property="quantity" /></td>
</tr>
</table>
<html:submit><bean:message
key="button.submit" /></html:submit>
</html:form>
</html:html>
</body>
</html>
4. my newitemForm.java in net.foong package
package net.foong;
import javax.servlet.http.HttpSer
vletReques
t;
import org.apache.struts.action.A
ctionForm;
import org.apache.struts.action.A
ctionMappi
ng;
public class newitemForm extends ActionForm {
private String itemName;
private String quantity;
public newitemForm() { super(); }
public void setItemName(String itemName) { this.itemName=itemName; }
public void setQuantity(String quantity) { this.quantity=quantity; }
public String getItemName() { return itemName; }
public String getQuantity() { return quantity; }
public void reset(ActionMapping mapping, HttpServletRequest request) {
this.itemName = null;
this.quantity = null;
}
}
*********
I can see the welcome.jsp page. I put the link in that page and enable user to click and view the page, but too bad i can onl;y the the exception shown in above... and i have no ideas...
Thank you.