Hello all.
I can't seem to figure this one out. My form object in my action class is always null.
Any help would be greatly appreciated. Here are my settings of importance:
Struts-config.xml:
<form-beans>
<form-bean name="ShoppingCartForm"
type="com.rana.release.forms.ShoppingCartForm" />
</form-beans>
<action-mappings>
<action path="/ShoppingCartAction"
type="com.rana.release.actions.ShoppingCartAction"
name="shoppingCart"
scope="session">
<forward name="success" path="/purchase.jsp"/>
<forward name="failure" path="/badTest.jsp"/>
</action>
</action-mappings>
what I do to get to this page is call the following from a jsp this way:
<html:link page="/ShoppingCartAction.do" >shopping cart</html:link>
And the purchase.jsp contains the following:
<html:form action="ShoppingCartAction" name="ShoppingCartForm"
type="com.rana.release.forms.ShoppingCartForm" scope="session">
<html:text property="quantity" /><br>
<html:submit>Checkout</html:submit>
</html:form>
For my action, the code is simply:
ShoppingCartForm shoppingCartForm = (ShoppingCartForm)form;
System.out.println(form);
And this results always in a null object. Any help would be greatly appreciated.
Thanks,
Stephane