ich versucht habeParameter von Thymleaf Seite
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Email</th>
<th>Send Invoice</th>
</tr>
</thead>
<tbody>
<tr class="table-row" th:each="p : ${POList}">
<td th:text="${p.email}"></td>
<td>
<form style='float:left; padding:5px; height:0px' th:object="${p}" th:method="post" th:action="@{/dashboard/makeAndSendInvoice/{email}(email=${p.email})}">
<button class="btn btn-default btn-xs" type="submit">Send Invoice</button>
</form>
</td>
</tr>
</tbody>
einen Parameter aus dieser thymleaf Seite zu senden und dann habe ich versucht, den Parameter (email
) mit diesem Code
@RequestMapping(method=POST, path="/makeAndSendInvoice/{email}")
public void makeAndSendInvoice(@PathVariable("email") String email) throws Exception {
System.out.println("Invoice is sent to..................."+email);
}
Das Problem ist, zu erhalten wenn der Wert von p.email
ist so etwas wie [email protected]
was ich in der Methode makeAndSendInvoice
erhalten, ist nur [email protected]
und es sendet mir nicht die .com
teil
Wie kann ich es beheben?
Ich glaube, Sie haben Fehler bei Ihrem Formularlayout gemacht, wenn Sie diese Zeit an E-Mails übergeben haben, die Sie im Browser debuggen, welcher Wert übergeben wird? –