I´ve read a lot but I did not find any good answers regarding to my problem. Indeed, this my class :
@Controller
public class ServletController {
@RequestMapping(value = {"", "/testControlP"}, method = RequestMethod.POST)
@ResponseBody
public void test(@RequestParam("visitor_name") String name,
@RequestParam("visitor_email") String email, @RequestParam("visitor_phone") String phone,
@RequestParam("total_adults") String total_adults, @RequestParam("total_children") String total_children,
@RequestParam("checkin") String checkin, @RequestParam("checkout") String checkout,
@RequestParam("visitor_message") String visitor_message) {
System.out.println("Name : " + name);
System.out.println("Email : " + email);
System.out.println("Phone : " + phone);
System.out.println("Total_adults : " + total_adults);
System.out.println("Total_children : " + total_children);
System.out.println("Checkin : " + checkin);
System.out.println("Checkout : " + checkout);
System.out.println("Visitor_message : " + visitor_message);
}
}
After launching the application, I´ve got this error : La méthode HTTP POST n''est pas supportée par cette URL ( HTTP POST method is not supported by this URL).
This is a part of my jsp page :
<form method="post">
<button type="submit" name="camper" formaction="testControlP">Test ServletSpring</button>
<hr>
Could you please help me ?
** I´ve already tried with no params and I got the same errors. (Server WildFly 21)