I agree with David. If you still have to use multiple forms use the following snippet
1<form method="POST" action="<portlet:actionURL name='addConsumers' />">
2<table>
3 <tr>
4 <td>Name:</td>
5 <td><Input type="text" name="name"/></td>
6 </tr>
7 <tr>
8 <td><Input type="submit" value="Send" title="Send"/></td>
9 </tr>
10 </table>
11</form>
12<br>
13The following form will add Vehicles to the database!
14<form method="POST" action="<portlet:actionURL name='addVehicles' />">
15<table>
16 <tr>
17 <td>Name:</td>
18 <td><Input type="text" name="name"/></td>
19 </tr>
20 <tr>
21 <td><Input type="submit" value="Send" title="Send"/></td>
22 </tr>
23 </table>
24</form>
25<br>
26The following form will add service-claims to the database!
27<form method="POST" action="<portlet:actionURL name='addServiceClaims' />">
28<table>
29 <tr>
30 <td>Name:</td>
31 <td><Input type="text" name="name"/></td>
32 </tr>
33 <tr>
34 <td><Input type="submit" value="Send" title="Send"/></td>
35 </tr>
36 </table>
37</form>
38<br>
39The following form will add warranty-claims to the database!
40<form method="POST" action="<portlet:actionURL name='addWarrantyClaims' />">
41<table>
42 <tr>
43 <td>Name:</td>
44 <td><Input type="text" name="name"/></td>
45 </tr>
46 <tr>
47 <td><Input type="submit" value="Send" title="Send"/></td>
48 </tr>
49 </table>
50</form>
And in your portlet class you will add something like the following assuming you are using MVCPortlet. You have to
Remove processAction method while while applying the solution mentioned below. Make sure the name of the method is same as name in the actionURL
1public void addConsumers(
2 ActionRequest actionRequest, ActionResponse actionResponse)
3 throws IOException, PortletException {
4
5 // Add code here to send an email
6 }
7
8public void addVehicles(
9 ActionRequest actionRequest, ActionResponse actionResponse)
10 throws IOException, PortletException {
11
12 // Add code here to send an email
13 }
14
15public void addWarrantyClaims(
16 ActionRequest actionRequest, ActionResponse actionResponse)
17 throws IOException, PortletException {
18
19 // Add code here to send an email
20 }
21
22public void addServiceClaims(
23 ActionRequest actionRequest, ActionResponse actionResponse)
24 throws IOException, PortletException {
25
26 // Add code here to send an email
27 }
28
29
30 public void addWarrantyClaims(
31 ActionRequest actionRequest, ActionResponse actionResponse)
32 throws IOException, PortletException {
33
34 // Add code here to send an email
35 }
Now when someone submits form for adding vehicles the addVehicles method in the portlet should get called. (Once again reminding, this solution is for portlets extending MVCPortlet)
Bitte melden Sie sich an, um diesen Inhalt als unangebracht zu kennzeichnen.