spring - How to do request mapping with form action? -


i want map form action controller class mapping doesn't found action.

it's quite general question. in general, have controller class (which mapped in configuration file) listens urls. example

@controller public class commoncontroller {  @requestmapping(value="/index", method=requestmethod.post) public string loginform(@modelattribute @valid user user, bindingresult results) {     return "index"; }  } 

in page containing form, set form action /index. example, if use thymeleaf

<form method="post" th:action="@{/index.html}" th:object="${user}"> ... </form> 

for more information, read spring guide.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -