开发者

Spring Passing request parameter

开发者 https://www.devze.com 2023-02-13 10:43 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消