Please help!
Background
==========
I have a class that extends the new
MappingDispatchAction
class
. This class has two methods, namely getCustomer and
updateCustomer.
The corresponding mapping for each method are below:
<action path="/getCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm"
scope="request"
validate="false"
input=".customerDef.jsp"
parameter="getCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
<action path="/updateCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm" scope="request"
validate="true"
input=".customerDef.jsp"
parameter="updateCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
my
jsp has three buttons, namelygetCustomer,
updateCustomer and cancel.
JSP CODE
========
The works with DispatchAction. However, due to the limitations of DispatchAction, I want to use the new MappingDispatchAction class.
<html:form action="/Customer">
<%-- onsubmit="return validateCargoForm(this);"--%>
<table width="500" border="0">
................
................
other fields....
................
................
<html:hidden property="methodToExecute" value="unknownMethod"/>
<SCRIPT>function set(target) {document.forms[0].methodToExecute.value=target;}</SCRIPT>
<html:submit on click="bCancel=true; set('getCustomers')">Get Customer</html:submit>
<html:submit on click= "set('updateCustomer')">Update Customer</html:submit>
<html:cancel/>
</html:form>
My question:
============
1. In my JSP, what what should be the value of the
ACTION attribute of html:form
i.e. <html:form action="???"> (i.e. which
mapping should be specified here)?
2. what should the code of the button for excuting
a. getCustomer and updateCustomer method be?
i.e. <html:submit ???
b. cancel be i.e. <html:cancel ???
Thank you.