|
SpringMVC 中控制器方法的参数列表可接受以下类型的参数, 并当该方法被调用时, SpringMVC 框架可使得方法能够获得正确的参数:
javax.servlet.ServletRequest 或 javax.servlet.http.HttpServletRequest;
javax.servlet.ServletRequest 或 javax.servlet.http.HttpServletRequest;
javax.servlet.http.HttpSession;
org.springframework.web.context.request.WebRequest 或 org.springframework.web.context.request.NativeWebRequest;
java.util.Locale;
java.io.InputStream 或 java.io.Reader;
java.io.OutputStream 或 java.io.Writer;
java.security.Principal;
org.springframework.http.HttpEntity<?>;
java.util.Map 或 org.springframework.ui.Model;
org.springframework.ui.ModelMap;
org.springframework.web.servlet.mvc.support.RedirectAttributes;
org.springframework.validation.Errors;
org.springframework.validation.BindingResult;
org.springframework.web.bind.support.SessionStatus;
org.springframework.web.util.UriComponentsBuilder;
表单对象
带有 @PathVariable, @MatrixVariable, @RequestParam, @RequestHeader, @RequestBody, @RequestPart 注释的对象;
以下为可返回的类型:
ModelAndView
Model
包含模型属性的 Map
View
代表逻辑试图名的 String
void
Callable
DeferredResult
————————————————
原文链接:https://blog.csdn.net/ass121/article/details/93750222
程序猿的技术大观园:www.javathinker.net
|
|