简体   繁体   中英

How to get method's request in springmvc

I have the next method:

@RequestMapping(value="/busqueda/basica", method = {RequestMethod.POST,RequestMethod.GET})
public String busquedaBasica(HttpServletRequest request,
                             HttpServletResponse response,
                             ModelMap modelMap,
                             @RequestParam("nombreBasica") String nombre){
    ...
}

Is there any way to get the method's request, POST or GET?

是的, HttpServletRequest具有一个getMethod() ,该方法返回一个表示HTTP方法的String值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM