I want to pass parameter (a String value) to spring controller from a jsp What is the best开发者_运维百科 or recommended way to do it. -I don't want to send parameters in URL - @RequestParam may not be suitable -Should I hook the parameter to a model object and use @ModelAttribute. What if I want just a string value to be passed.. should I create a object with just a string attribute for this purpose? -Use HttpSevletRequest
Use @RequestParam
- it will work with both GET and POST requests. So if you don't want to send them in the URL, use the POST
method to submit your form.
精彩评论