当前位置: 首页 > news >正文

北京理工大学网站开发与应用英文商务网站制作

北京理工大学网站开发与应用,英文商务网站制作,郑州展厅设计制作公司,海口cms模板建站spring配置 有5个网址 springboot 再讲一遍 spring的学习最好的方法是运行 官方demo 学习它里面的配置 。 我们不可能一下子理解spring里面的源码 spring配置直接复制好了 视频老师也是从官方demo中复制过来的 直接复制 **********************************…spring配置 有5个网址   springboot 再讲一遍  spring的学习最好的方法是运行  官方demo  学习它里面的配置   。 我们不可能一下子理解spring里面的源码    spring配置直接复制好了      视频老师也是从官方demo中复制过来的 直接复制 ******************************************************************************************************************************************** 1.首先讲web.xml ?xml version1.0 encodingUTF-8? web-app xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlnshttp://java.sun.com/xml/ns/javaeexsi:schemaLocationhttp://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsdidWebApp_ID version2.5display-nameArchetype Created Web Application/display-name!-- CharacterEncodingFilter 配置过滤器 为了转码用的 --filterfilter-namecharacterEncodingFilter/filter-namefilter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-classinit-paramparam-nameencoding/param-nameparam-valueUTF-8/param-value/init-paraminit-paramparam-nameforceEncoding/param-nameparam-valuetrue/param-value/init-param/filterfilter-mappingfilter-namecharacterEncodingFilter/filter-name!-- /* 拦截所有请求 走CharacterEncodingFilter我们就不用再写转utf-8这种了过滤所有的请求 --url-pattern/*/url-pattern/filter-mappinglistener!-- web容器启动和关闭的监听器 只是监听web容器的启动和关闭 --listener-classorg.springframework.web.context.request.RequestContextListener/listener-class/listenerlistener!-- ContextLoaderListener web容器和spring容器进行整合进行监听 --listener-classorg.springframework.web.context.ContextLoaderListener/listener-class/listenercontext-paramparam-namecontextConfigLocation/param-nameparam-value!-- 指向spring配置文件 --classpath:applicationContext.xml!-- ContextLoaderListener 会 通过applicationContext.xml、将spring容器和web容器进行整合--/param-value/context-paramservlet!--DispatcherServlet 配置spring-mvc --servlet-namedispatcher/servlet-nameservlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class!-- 指定SpringMVC的文件 不写是 默认dispatcher-servlet.xml名字 --!--init-param--!--param-namecontextConfigLocation/param-name--!--param-value/WEB-INF/spring-mvc.xml/param-value--!--param-value/WEB-INF/xxxx.xml (叫什么名字都可以)/param-value--!--/init-param--!-- servlet的配置 当大于等于0 就在容器启动时初始化这个servlet小于0或不指定 只有请求时才初始化servlet--load-on-startup1/load-on-startup/servletservlet-mapping!-- DispatcherServlet dispatcher 引用上面的springmvc配置 拦截所有的*.do --servlet-namedispatcher/servlet-name!-- springmvc 将所有的*.do进行拦截 --url-pattern*.do/url-pattern/servlet-mapping!--NFDFlightDataTaskListener 监听器--!--listener--!--listener-classcom.zjyouth.utils.NFDFlightDataTaskListener/listener-class--!--/listener--/web-app ******************************************************************************************************************************************** 1.首先讲web.xml 2.再讲一下spring容器的主配置     applicationContext.xml ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:aophttp://www.springframework.org/schema/aopxmlns:txhttp://www.springframework.org/schema/tx xmlns:jdbchttp://www.springframework.org/schema/jdbcxmlns:contexthttp://www.springframework.org/schema/contextxmlns:taskhttp://www.springframework.org/schema/taskxsi:schemaLocationhttp://www.springframework.org/schema/taskhttp://www.springframework.org/schema/task/spring-task-3.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd!-- spring容器的主配置 --!-- 扫描com.zjyouth下的一些注解 可以很方便的进行注入context:component-scan base-packagecom.zjyouth annotation-configtrue/--context:component-scan base-packagecom.zjut annotation-configtrue/!-- 定时 --context:component-scan base-packagecom.zjyouth.* /task:executor idexecutor pool-size5 /task:scheduler idscheduler pool-size10 /task:annotation-driven executorexecutor schedulerscheduler /!-- context:annotation-config/--!--在使用spectj注解实现springAOP1.需要使用Aspect注解来标注切面2.可以使用before,afterRuning,around,afterThrowning注解来标注通知3.必须有切入点point-cut,使用pointcut(execution())注解来标注切入点4.在aop.xml中需要有https://blog.csdn.net/qq_37761074/article/details/72859266Spring配置- - -aop:aspectj-autoproxy /2017年11月01日 11:54:08 阅读数488更多个人分类 日记版权声明本文为博主原创文章未经博主允许不得转载。 https://blog.csdn.net/ke_zhang_123/article/details/78412536aop:aspectj-autoproxy proxy-target-classtrue/ 基于类的动态代理(依赖于CGlib库)通过配置织入Aspectj切面--!-- aop的配置 spring配置文分成多个文件 datasource.xml --aop:aspectj-autoproxy/!-- spring配置文件 dataSource分出来的子文件 --import resourceapplicationContext-datasource.xml//beans ******************************************************************************************************************************************** 1.首先讲web.xml 2.再讲一下spring容器的主配置     applicationContext.xml 3.spring配置文件 dataSource分出来的子文件   applicationContext-datasource.xml ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:aophttp://www.springframework.org/schema/aopxmlns:txhttp://www.springframework.org/schema/tx xmlns:jdbchttp://www.springframework.org/schema/jdbcxmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd!-- spring容器的自配置文件 --!-- 扫描com.zjyouth下的所有注解 context:component-scan base-packagecom.zjyouth annotation-configtrue/--context:component-scan base-packagecom.zjut annotation-configtrue/!-- 将常量分离出来 分出1个文件 --bean idpropertyConfigurerclassorg.springframework.beans.factory.config.PropertyPlaceholderConfigurerproperty nameorder value2/property nameignoreUnresolvablePlaceholders valuetrue/property namelocationslist!-- 将常量分离出来 分出1个文件 --valueclasspath:datasource.properties/value/list/property!-- 指定字符集 --property namefileEncoding valueutf-8//bean!-- dbcp数据库连接池配置 使用dbcp数据库连接池 --bean iddataSource classorg.apache.commons.dbcp.BasicDataSource destroy-methodcloseproperty namedriverClassName value${db.driverClassName}/property nameurl value${db.url}/property nameusername value${db.username}/property namepassword value${db.password}/!-- 连接池启动时的初始值 --property nameinitialSize value${db.initialSize}/!-- 连接池的最大值 --property namemaxActive value${db.maxActive}/!-- 最大空闲值.当经过一个高峰时间后连接池可以慢慢将已经用不到的连接慢慢释放一部分一直减少到maxIdle为止 --property namemaxIdle value${db.maxIdle}/!-- 最小空闲值.当空闲的连接数少于阀值时连接池就会预申请去一些连接以免洪峰来时来不及申请 --property nameminIdle value${db.minIdle}/!-- 最大建立连接等待时间。如果超过此时间将接到异常。设为1表示无限制 --property namemaxWait value${db.maxWait}/!--#给出一条简单的sql语句进行验证 --!--property namevalidationQuery valueselect getdate() /--property namedefaultAutoCommit value${db.defaultAutoCommit}/!-- 回收被遗弃的一般是忘了释放的数据库连接到连接池中 --!--property nameremoveAbandoned valuetrue /--!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 --!--property nameremoveAbandonedTimeout value120 /--!-- #连接的超时时间默认为半小时。 --property nameminEvictableIdleTimeMillis value${db.minEvictableIdleTimeMillis}/!--# 失效检查线程运行时间间隔要小于MySQL默认--property nametimeBetweenEvictionRunsMillis value40000/!--# 检查连接是否有效--property nametestWhileIdle valuetrue/!--# 检查连接有效性的SQL语句--property namevalidationQuery valueSELECT 1 FROM dual//bean!-- 这个配置重要 是mybatis的sqlSesstion的bean --bean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBean!-- refdataSource 指的是上面dpcp数据库连接池 --property namedataSource refdataSource/!-- 这个就能读取到mybatis的所有的实现 --property namemapperLocations valueclasspath*:mappers/*Mapper.xml/property!-- 分页插件 在加上 pom中配置jar mybatis的分页插件就配置好了 --property namepluginsarraybean classcom.github.pagehelper.PageHelperproperty namepropertiesvalue!-- 指明一下方言是mysql --dialectmysql/value/property/bean/array/property/bean!-- mybatis 扫描包的方式 --!-- mybatis的一个扫描 会扫描dao层 对service层提供接口 这个配置很重要 --bean namemapperScannerConfigurer classorg.mybatis.spring.mapper.MapperScannerConfigurer!-- 空格删一些不然报错 property namebasePackage valuecom.zjyouth.dao/ --property namebasePackage valuecom.zjut.rtcf.dao//bean!-- spring事务管理的配置 --!-- 使用Transactional进行声明式事务管理需要声明下面这行 --tx:annotation-driven transaction-managertransactionManager proxy-target-classtrue /!-- 事务管理 --bean idtransactionManager classorg.springframework.jdbc.datasource.DataSourceTransactionManager!-- 数据库连接池 dbcp --property namedataSource refdataSource/!-- 提交事务失败 出错是否回滚 true 回滚 --property namerollbackOnCommitFailure valuetrue//bean/beans spring配置讲完了   ******************************************************************************************************************************************** 1.首先讲web.xml 2.再讲一下spring容器的主配置     applicationContext.xml 3.spring配置文件 dataSource分出来的子文件   applicationContext-datasource.xml     spring配置讲完了   4.再讲一下spring mvc配置     dispatcher-servlet.xml  (名字可以在web.xml里面修改) ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:phttp://www.springframework.org/schema/pxmlns:contexthttp://www.springframework.org/schema/contextxmlns:mvchttp://www.springframework.org/schema/mvc xmlns:aophttp://www.springframework.org/schema/aopxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc.xsd!-- springmvc配置文件 这个是默认的名字 dispatcher-servlet.xml --!-- 扫描controller注解 context:component-scan base-packagecom.zjyouth annotation-configtrue/--context:component-scan base-packagecom.zjut.rtcf annotation-configtrue/mvc:annotation-drivenmvc:message-convertersbean classorg.springframework.http.converter.StringHttpMessageConverterproperty namesupportedMediaTypeslist!-- 配置字符集 --valuetext/plain;charsetUTF-8/valuevaluetext/html;charsetUTF-8/value/list/property/bean!-- ResponseBody 注解将对象数据直接转换为json数据 --!-- SpringMVC自动进行反序列化的时候 的配置类 Jackson配置类 --bean classorg.springframework.http.converter.json.MappingJacksonHttpMessageConverter!-- 返回对象的时候 返回的可以是null 通过配置就过滤这个 本项目使用默认配置就不要了 --!--property nameobjectMapper--!--bean classorg.codehaus.jackson.map.ObjectMapper--!--property nameserializationInclusion valueNON_EMPTY/--!--/bean--!--/property--property namesupportedMediaTypeslist!-- 字符集 --valueapplication/json;charsetUTF-8/value/list/property/bean/mvc:message-converters/mvc:annotation-driven!-- --!-- 文件上传 直接使用SpringMVC提供的multipart这个工具就好了 --bean idmultipartResolver classorg.springframework.web.multipart.commons.CommonsMultipartResolverproperty namemaxUploadSize value10485760/ !-- 单位字节 上传的最大字节10m --property namemaxInMemorySize value4096 / !-- 单位字节 最大内存4M 块的大小 --property namedefaultEncoding valueUTF-8/property !-- 默认编码 --/bean!-- SpringMVC配置讲完了 --/beans********************************************************************************************************************************************
http://www.huolong8.cn/news/349465/

相关文章:

  • 旅游网站设计页面wordpress导航分类怎么添加new
  • 网站开发前台与后台的交互网站维护有文化建设费
  • 有的网站显示正在建设中网页游戏排行榜西游
  • 做贸易要看什么网站网站外链建设书籍
  • 清远网站推广优化公司做网站需要多久
  • 人才网站查询档案企业网站规划与开发
  • 网络企业做网站徐州市建设局官方网站
  • win2008的iis7建网站流程房产网站系统哪个好
  • 温江 网站建设快递网站模版
  • 快递系统专注快递企业网站开发长沙网站推广排名优化
  • 河北农业建设信息网站营销网站建设的公司
  • 定州市住房保障和城乡建设局网站网站有风险提示怎么办
  • 建设一个网站需要什么技术指标中太建设集团网站
  • 深圳市建设工程质量检测中心网站编程开源网站
  • 网站建设项目验收方案彩票网站的建设
  • 2017湖北建设教育协会网站wordpress太强大
  • 怎么做电影流量网站网站关键词如何布局
  • 中国站免费推广入口wordpress 功能 删除
  • custed谁做的网站开网店怎么卖到外国
  • 门户网站服务范围简述网站建设方法
  • 做网站需要跟客户了解什么网站建设合同技术开发合同
  • 太原免费网站建站模板网站建设流程有几个阶段
  • 网站备案每年一次吗名医工作室 网站建设
  • 安徽城乡建设厅官方网站福州做网站的公司电话
  • 网站建站公司哪家价钱合理网站整体设计
  • 建设银行积分网站wordpress 时间代码
  • 如何通过域名访问网站网站开发 定制 多少 钱
  • 网站备案是什么建工教育网校官方网站
  • 网站建站系统有哪些益阳市住房和建设局 网站
  • 高校网站群建设免费建设小说网站