Is it possible that I can get HttpRequest object in my Controller class in Spring MVC ?
@Controller
public class ContactController {
@Autowired
private ContactService contactService;
@RequestMapping("/login")
public String displayLoginPage(@ModelAttribute("login") Login login, BindingResult result) {
return "login";
}
}
@RequestMapping("/login")
public String displayLoginPage(HttpServletRequest request, @ModelAttribute("login") Login login, BindingResult result){
return "login";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With