2021年04月10日 springMVC(1)
- IoC(控制反转Inversion of Control)/DI(依赖注入Dependency Injection)
- AOP(面向切面编程Aspect Oriented Programming)
1.springMVC是可以独立使用的
SSM
spring+Mybatis 组合
spring+Hibernate 组合
SSH
struts+Mybatis 组合
struts+Hibernate 组合
2.宏观
核心配置文件都有这三个东西
【1】URL的 处理映射器 handler(处理)
【2】控制器的 处理适配器 mvc(控制)
【3】(内部)资源视图解析器 view(视图)
loose 松开;解开 (物)
solve 解开;解决 (事)
resolve 解决;决心 (人)
3. 侵入式与非侵入式框架
重量级――是否为侵入式框架(要求用户自己的类继承框架的类或接口)
轻量级
4.code实例
springmvc.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd "> <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="hello.do">controller1prop> props> property> bean> <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"/> <bean name="controller1" class="com.hzy.demo.controller.Controllers" />beans>
web.xml 文件:
这个地方报错,Typo: In word ‘springmvc’,所以改成了springMvc
controller类
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。