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

赫山区住房和城乡建设局网站重庆刮刮卡制作

赫山区住房和城乡建设局网站,重庆刮刮卡制作,焦作网络推广哪家好,如何建设局域网内部网站大家好#xff0c;我是雄雄#xff0c;今天来带着大家来配置一下SSM#xff08;springspringmvcmybatis#xff09;框架。01新建java web项目直接在myeclipse中#xff0c;新建一个web项目即可。02导入jar包将SSM所需的jar包复制到项目的/WebRoot/WEB-INF/lib中#xff0… 大家好我是雄雄今天来带着大家来配置一下SSMspringspringmvcmybatis框架。01新建java web项目直接在myeclipse中新建一个web项目即可。02导入jar包将SSM所需的jar包复制到项目的/WebRoot/WEB-INF/lib中在这里我整理了下大致需要34个jar文件复制完之后选中所有jar包右击—Build Path--Add to Build Path。03配置web.xml文件。web.xml文件需要配置三部分信息spring、springmvc以及解决springmvc传值乱码的过滤器分别如下spring配置信息listenerlistener-classorg.springframework.web.context.ContextLoaderListener/listener-class/listenercontext-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:applicationContext.xml/param-value/context-paramspringmvc配置信息servletservlet-namespringmvc/servlet-nameservlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-classinit-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:springmvc-servlet.xml/param-value/init-paramload-on-startup1/load-on-startup/servletservlet-mappingservlet-namespringmvc/servlet-nameurl-pattern//url-pattern/servlet-mapping设置编码格式的过滤器信息!-- 解决springmvc传递值乱码问题 --filterfilter-nameencodingFilter/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-nameencodingFilter/filter-nameurl-pattern/*/url-pattern/filter-mapping04配置Spring配置文件applicationContext.xml文件里面需要包含这些信息用来连接数据库的数据源信息!-- 配置数据源--bean iddataSource classorg.springframework.jdbc.datasource.DriverManagerDataSourceproperty namedriverClassName valuecom.mysql.jdbc.Driver/propertyproperty nameurl valuejdbc:mysql://localhost:3306/schooldb/propertyproperty nameusername valueroot/propertyproperty namepassword valueroot/property/bean加载mybatis-config.xml文件以及sql映射文件的SqlSessionFactory!--sqlSessionFactory --bean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBeanproperty namedataSource refdataSource/propertyproperty nameconfigLocation valueclasspath:mybatis-config.xml/propertyproperty namemapperLocationslistvalueclasspath:org/dao/*.xml/value/list/property/beanMapper注入映射器的MapperScannerConfigurer!-- 配置自动映射器 --bean classorg.mybatis.spring.mapper.MapperScannerConfigurerproperty namebasePackage valueorg.dao/property/bean最后就是扫描注解的配置!-- 扫描所有注解信息 --context:component-scan base-packageorg.dao,org.service,org.web/mvc:annotation-driven/05配置springmvc的信息springmvc-servlet.xml中需要包含最基本的两个部分扫描注解和springmvc请求的前缀后缀设置!-- 扫描注解 --context:component-scan base-packageorg.web,org.dao,org.service/mvc:annotation-driven/!-- 配置前缀和后缀 --bean classorg.springframework.web.servlet.view.InternalResourceViewResolverproperty nameprefix value//propertyproperty namesuffix value.jsp/property/bean06配置mybatis配置文件本文件简单点就配置个别名和打印sql语句就行都是可选的?xml version1.0 encodingUTF-8 ? !DOCTYPE configurationPUBLIC -//mybatis.org//DTD Config 3.0//ENhttp://mybatis.org/dtd/mybatis-3-config.dtd configurationsettings!-- 打印sql语句 --setting namelogImpl valueSTDOUT_LOGGING //settings!-- 起别名 --typeAliasespackage nameorg.entity//typeAliases/configuration附录spring配置文件applicationContext.xml?xml version1.0 encodingUTF-8? beansxmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:phttp://www.springframework.org/schema/pxmlns:aophttp://www.springframework.org/schema/aopxmlns:mvchttp://www.springframework.org/schema/mvcxmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsdhttp://www.springframework.org/schema/p http://www.springframework.org/schema/p/spring-p-3.1.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsdhttp://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd!-- 配置数据源--bean iddataSource classorg.springframework.jdbc.datasource.DriverManagerDataSourceproperty namedriverClassName valuecom.mysql.jdbc.Driver/propertyproperty nameurl valuejdbc:mysql://localhost:3306/schooldb/propertyproperty nameusername valueroot/propertyproperty namepassword valueroot/property/bean!--sqlSessionFactory --bean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBeanproperty namedataSource refdataSource/propertyproperty nameconfigLocation valueclasspath:mybatis-config.xml/propertyproperty namemapperLocationslistvalueclasspath:org/dao/*.xml/value/list/property/bean!-- 配置自动映射器 --bean classorg.mybatis.spring.mapper.MapperScannerConfigurerproperty namebasePackage valueorg.dao/property/bean!-- 扫描所有注解信息 --context:component-scan base-packageorg.dao,org.service,org.web/mvc:annotation-driven//beansspringmvc配置文件springmvc-servlet.xml?xml version1.0 encodingUTF-8? beansxmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:phttp://www.springframework.org/schema/pxmlns:aophttp://www.springframework.org/schema/aopxmlns:mvchttp://www.springframework.org/schema/mvcxmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsdhttp://www.springframework.org/schema/p http://www.springframework.org/schema/p/spring-p-3.1.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsdhttp://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd!-- 扫描注解 --context:component-scan base-packageorg.web,org.dao,org.service/mvc:annotation-driven/!-- 配置前缀和后缀 --bean classorg.springframework.web.servlet.view.InternalResourceViewResolverproperty nameprefix value//propertyproperty namesuffix value.jsp/property/bean/beansweb.xml文件?xml version1.0 encodingUTF-8? web-app version3.0 xmlnshttp://java.sun.com/xml/ns/javaee xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsddisplay-name/display-name  welcome-file-listwelcome-fileindex.jsp/welcome-file/welcome-file-list!-- springmvc的配置 --servletservlet-namespringmvc/servlet-nameservlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-classinit-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:springmvc-servlet.xml/param-value/init-paramload-on-startup1/load-on-startup/servletservlet-mappingservlet-namespringmvc/servlet-nameurl-pattern//url-pattern/servlet-mapping!-- spring --context-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:applicationContext.xml/param-value/context-param!-- 监听配置 --listenerlistener-classorg.springframework.web.context.ContextLoaderListener/listener-class/listener!-- 解决springmvc传递值乱码问题 --filterfilter-nameencodingFilter/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-nameencodingFilter/filter-nameurl-pattern/*/url-pattern/filter-mapping/web-app配置到此结束明天带着大家实现一遍SSM的增删改查案例。独家特制纯手工辣椒酱小商店现在下单单件商品立减1.88元满80元减15元.往期精彩投资理财要趁早基金风险是最小2021-01-10 java中的泛型类型擦除2021-01-12 一百馒头一百僧大僧三个更无争小僧三人分一个大小和尚得几丁2021-01-09 你们好好的学回头教教我~2021-01-08 辣椒酱中奖说明~2021-01-07 点分享点点赞点在看
http://wiki.neutronadmin.com/news/303042/

相关文章:

  • 网站建设中的服务器搭建方式宣传策划方案
  • html嵌入网站高科技公司网站模板
  • c 网站开发中间层怎么写帝国网站源码手机
  • 专门做产品推广ppt的网站深圳注册公司需要租赁凭证吗
  • 开一个网站需要什么企业融资风险及其防范措施
  • 网站如何做竟价可以做科学模拟实验的网站
  • 做企业竞争模拟的网站wordpress安装主题主机名
  • 商城网站设计制作谷歌有趣的网站
  • 承德网站制作公司江西省seo
  • 安徽省建设干部网站网站建设与管理答案
  • 开发商城网站建设永久免费做网站
  • 怎样将自己做的网站发布到外网上ppt模板大全免费下载网站
  • 网站外链代发网站推广妙招
  • 做网站和做app哪个容易三只松鼠广告策划书
  • 深圳企业公司做网站虚拟主机可以做视频网站嘛
  • 五星酒店网站建设方案威海做网站公司
  • 网站多久才能做起来百度竞价 百度流量 网站权重
  • 制作一号店网站烟台市住房和城乡建设局网站
  • 宝塔面板做网站绑定域名wordpress搜索 文章
  • 网站首页广告图片伸缩代码又关闭做网站用什么软件设计好
  • 开一家网络公司做网站前景如何雄安专业网站建设电话
  • 网站设计参考常州微网站建设
  • 网站建设的7种流程贵州网站制作哪家好
  • 公司经营范围 网站开发wordpress图片简码
  • 网站商城制作费用市场营销策划
  • 前端网站搜索导航怎么做怎样注册网店开网店
  • 网站小视频怎么做代理商益阳网络推广
  • 手机网站制作设计广州网站优化指导
  • 自驾游网站建设方案哈尔滨cms网站建设
  • 整站优化系统网站h1标签用在哪里