将 doPost 与 link 一起使用

Use doPost with link

我正在与 html/ftl 一起开发 Java-Project 等等...

我有一个包含如下列表的 ftl 文件:

<table id="availableHOs">
 <tr>
  <th>#</th>
  <th>Street</th>
  <th>Town</th>
  <th>Capacity</th>
 </tr>
 <#list availableOffers as ho>
 <tr>
  <td><a href="guestgui?action=selectHolidayOffer&amp;hid=${ho.id}" title="Make Booking">${ho.id}</a></td>
  <td>${ho.addressData.street}</td>
  <td>${ho.addressData.town}</td>
  <td>${ho.capacity}</td>
 </tr>
 </#list>
</table>

(这是我们从大学里得到的模板。) 我的问题是 table 中的 Link(标题为 "Make Booking" 使用 GET 而不是 POST。有人可以帮我把它改成 POST? 我只有一个带有提交按钮和表单的示例:

<form method="POST" action="guestgui?action=projekteSuchenU">

但我不知道如何在 table 中使用它。 总之,我想要一个 table / 列表,其中我有一个 link 用于与 POST

一起使用的每一行

我是这个话题的新手,所以请原谅我的错误解释!

谢谢!

添加表单而不是标签 'a':

<table id="availableHOs">
        <tr>
                <th>#</th>
                <th>Street</th>
                <th>Town</th>
                <th>Capacity</th>
        </tr>
        <#list availableOffers as ho>
        <tr>
                <td>
                        <form method="POST" action="guestgui?action=selectHolidayOffer&amp;hid=${ho.id}">
                                <input type="submit" value="${ho.id}"/>
                        </form>
                </td>
                <td>${ho.addressData.street}</td>
                <td>${ho.addressData.town}</td>
                <td>${ho.capacity}</td>
        </tr>
        </#list>
</table>