SSM框架操作(spring,spring mvc,mybatis) 1 web.xml配置 DispatcherServlet,乱码处理,配置spring容器监听器ContextLoaderListener

2 spring组件扫描controller,注解处理器映射器RequestMappingHandlerMapping,注解适配器RequestMappingHandlerAdapter(注解)

3 数据库连接,Mybatis的SqlsessionFactory,扫描mapper类

4 service 实现类

5 transactionManager

做非空判断传Integer,如果传int会出错 1查询功能 1点击页面a标签会跳转到struts.xml去找action的属性name相对应的名字(findAllBookInfo2) img_9.png 2匹配到action的name后,会根据class属性的值进入action类找注解值为(bookinfoAction)的类,并寻找method属性对应的值(findAll),执行值对应的方法。如果值不等于空则返回(toBookListJsp)。

img_10.png img_11.png 3在请求名所对应的result的name中找到返回名,根据type属性,跳转到不同页面。 img_12.png