非注解映射器和适配器
MyController.java:
HttpController.java:
映射器
-
BeanNameUrlHandlerMapping
将bean(myController)的name作为url进行查找
地址:http://localhost:8080/ssm-test/hello.do -
SimpleUrlHandlerMapping
bean有多个URL与之映射
地址:http://localhost:8080/ssm-test/hello.do
http://localhost:8080/ssm-test/ss.do
http://localhost:8080/ssm-test/abc.do -
ControllerClassNameHandlerMapping
类名映射
地址:http://localhost:8080/ssm-test/hello.do
http://localhost:8080/ssm-test/myController.do
适配器
-
SimpleControllerHandlerAdapter
实现controller接口–>>MyController.java -
HttpRequestHandlerAdapter
实现HttpRequestHandler接口–>>HttpController.java
视图解析器
- InternalResourceViewResolver
拼接成一个Web应用内部资源路径 = 前缀 + 视图名称 + 后缀.
地址:http://localhost:8080/ssm-test/index.jsp
- BeanNameViewResolver
将资源(内部资源和外部资源)封装为bean实例, 然后在 ModelAndView 中通过设置bean实例的id值来指定资源. 在配置文件中可以同时配置多个资源bean.
内部地址:http://localhost:8080/ssm-test/inIndex.jsp
外部地址:https://www.baidu.com/