I'm trying to work with DynaActionForm. When I try to access my page it gives me following exception
Exception creating bean of class selectica.DynamicLookupForm: {1}
Can you kindly let me know what could be the possible problem.
My struts-config.xml
<?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="LookupFormBean" type="selectica.LookupForm"/>
<form-bean name="dynamicLookupForm" type="selectica.DynamicLookupForm">
<form-property name="symbol" type="java.lang.String" initial="MSFT"/>
</form-bean>
</form-beans>
<action-mappings>
<action path="/Lookup" type="selectica.LookupAction" name="LookupFormBean">
<forward name="success" path="/quote.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
</action-mappings>
<action-mappings>
<action path="/DynamicLookup" type="selectica.DynamicLookupAction" name="dynamicLookupForm">
<forward name="success" path="/quote.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
</action-mappings>
</struts-config>
My dynamicindex.jsp
<%@ page language="java"%>
<%@ taglib uri = "/WEB-INF/struts-html.tld" prefix="html"%>
<html>
<head>
<title>Wrox struts Application</title>
</head>
<body>tertwr
<table width="500" border="0" cellspacing="0" cellpadding="0">
hello.....
<tr>
<td> </td>
</tr>
<tr>
<td height="68" width="48%">
<div align="left">
<img src="images/new.gif">
</div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<html:form action="/DynamicLookup">
Symbol: <html:text property="symbol"/>
<html:submit/>
</html:form>
</body>
</html>
My DynamicLookupAction
package selectica;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class DynamicLookupAction extends Action
{
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
{
String target=new String("failure");
Double price=null;
if(form !=null)
{
DynaActionForm lform=(DynaActionForm)form;
String symbol=(String)lform.get("symbol");
if(symbol.equals("Selectica"))
{
price = new Double(25.00);
request.setAttribute("PRICE",price);
target="success";
}
}
return mapping.findForward(target);
}
}
The error occurs when I try to access dynamicindex.jsp
Thanks in Advance
Kirty