SpringMVC学习记录
1E)Spring MVC框架


<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"><bean id="userBean" class="Spring_Bean.UserBean"><property name="username" value="kam"></property><property name="password" value="123456"></property></bean><bean id="userDao" class="Spring_Dao.UserDaoImpl"></bean><bean id="userService" class="Spring_Service.UserServiceImpl"><property name="daoInf" ref="userDao"></property></bean></beans>
@Service用于标注业务层的组件,@Controller用于标注控制层组件(如struts中的action),@Repository用于标注数据访问组件,即DAO组件,而@Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。但是在目前的spring版本中,这几个注解的作用是一样的,但是在以后可能会进行区分。 |
<?xml version="1.0" encoding="UTF-8"?><!--- Middle tier application context definition for the image database.--><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:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"><!-- 扫描cn.CMSystem的bean --><context:component-scan base-package="cn.CMSystem"> </context:component-scan></beans>
SpringMVC学习记录的更多相关文章
- springMVC学习记录1-使用XML进行配置
SpringMVC是整个spring中的一个很小的组成,准确的说他是spring WEB这个模块的下一个子模块,Spring WEB中除了有springMVC还有struts2,webWork等MVC ...
- SpringMVC学习记录5
Springmvc流程中的扩展点有很多,可以在很多地方插入自己的代码逻辑达到控制流程的目的. 如果要对Controller的handler方法做统一的处理.我想应该会有很多选择,比如:@ModelAt ...
- SpringMVC学习记录4
主题 SpringMVC有很多很多的注解.其中有2个注解@SessionAttributes @ModelAttribute我平时一般不用,因为实在是太灵活了.但是又有一定限制,用不好容易错.. 最近 ...
- SpringMVC学习记录3
这次的主题 最近一直在学习SpringMVC..(这句话我已经至少写了3,4遍了....).这次的研究主要是RequestMappingHandlerAdapter中的各种ArgumentsResol ...
- SpringMVC学习记录2
废话 最近在看SpringMVC...里面东西好多...反正东看一点西看一点吧... 分享一下最近的一些心得..是关于DispatcherServlet的 DispatcherServlet与Cont ...
- springMVC学习记录2-使用注解配置
前面说了一下使用xml配置springmvc,下面再说说注解配置.项目如下: 业务很简单,主页和输入用户名和密码进行登陆的页面. 看一下springmvc的配置文件: <?xml version ...
- SpringMVC学习记录1
起因 以前大三暑假实习的时候看到公司用SpringMVC而不是Struts2,老司机告诉我SpringMVC各种方便,各种解耦. 然后我自己试了试..好像是蛮方便的.... 基本上在Spring的基础 ...
- springMVC学习记录3-拦截器和文件上传
拦截器和文件上传算是springmvc中比较高级一点的内容了吧,让我们一起看一下. 下面先说说拦截器.拦截器和过滤器有点像,都可以在请求被处理之前和请求被处理之到做一些额外的操作. 1. 实现Hand ...
- SpringMVC学习记录七——sjon数据交互和拦截器
21 json数据交互 21.1 为什么要进行json数据交互 json数据格式在接口调用中.html页面中较常用,json格式比较简单,解析还比较方便. 比如:webservi ...
随机推荐
- jqgrid在页面出来竖型滚动条自动调整列宽
在项目中使用jqgrid的时候,需要设置在页面竖型滚动条出来的时候,列宽进行调整 1. 判断jqgrid的宽度是否和页面的宽度不一致(判断滚动条是否出来) 2. 调整jqgrid的列宽,因为jqgri ...
- Hadoop MapReduce编程 API入门系列之mr编程快捷键活用技巧详解(四)
1.Shift + Alt + S Hadoop没有使用jdk自带的默认序列化机制. 现在呢,hadoop-2.*里有两套序列化机制.一个是自己hadoop的序列化机制,一个是谷歌的. 所以,要改为. ...
- 教程-最全ASCII 码对照表
第一部分由 00H 到 1FH 共 32 个,一般用来通讯或作为控制之用,有些字符可显示于屏幕,有些则无法显示在屏幕上,但能看到其效果(例如换行字符.归位字符). 第二部分是由 20H 到 7FH 共 ...
- hdoj 1262 寻找素数对
寻找素数对 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submi ...
- [iOS基础控件 - 6.7] 微博展示 使用代码自定义TableCell(动态尺寸)
A.需求 1.类似于微博内容的展示 2.头像 3.名字 4.会员标志 5.内容 6.分割线 7.配图(可选,可有可无) code source: https://github.com/hellov ...
- CentOS6.5安装MySQL及完全卸载
原文地址:http://www.cnblogs.com/zhongshengzhen/ 第1步.yum安装mysql [root@localhost ~]# yum -y install mysql- ...
- .Net Core-TagHelpers-Environment
当我们新建一个.net core项目时,发现页面中有个奇怪的TagHelper元素,如下: <environment names="Development"> ...
- MFC 学习之 鼠标移动到Toolbar按钮上显示提示信息(tooltip),状态栏也随之改变
1.在ResourceView里加入Toolbar资源,命名IDR_TOOLBAR1 2.在主程序的.h文件中加入变量: CToolBar m_toolbar;CImageList ...
- metasploit(MSF)终端命令大全
show exploits 列出metasploit框架中的所有渗透攻击模块. show payloads 列出metasploit框架中的所有攻击载荷. show auxiliary 列 ...
- iOS 关闭自动锁屏
[UIApplication sharedApplication].idleTimerDisabled=YES;// 不自动锁屏 [UIApplication sharedApplication].i ...