我爱编程

springmvc+mybatis怎么传值到xml【转】

2016-09-26  本文已影响82人  mingli_jianshu1

直接上代码  首先是从程序的入口开始说:

web.xml

xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

index.jsp

设置session过期的时间

读取spring的配置文件

-->

contextConfigLocation

classpath:config/spring.xml;classpath:config/spring-myBatis.xml

org.springframework.web.context.ContextLoaderListener

org.springframework.web.util.IntrospectorCleanupListener

设置字符编码,将所有的字符编码同意设置为utf-8

-->

filterEncoding

org.springframework.web.filter.CharacterEncodingFilter

encoding

utf-8

filterEncoding

生成一次性验证码的servlet

-->

verifyCode

com.longhang.tool.verifyCode.VerifyCodeServlet

将所有*.do的请求交给springMVC的DispatcherServlet来处理

-->

DispatcherServlet

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:config/springMVC-config.xml

1

verifyCode

/verifyCode

DispatcherServlet

*.do

springMVC的配置文件

http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"

xmlns:context="http://www.springframework.org/schema/context"

xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.0.xsd

http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.0.xsd

http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.0.xsd">

配置自动扫描的包,让其扫描    com.longhang,controller下面的所有包

-->

配置视图解析器

将视图逻辑名解析为/*.jsp

-->

spring.xml的配置

http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="

http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-3.0.xsd

">

spring-myBatis.xml配置

http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="

http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/tx

http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

"

自动扫描 将Mapper接口生成代理注入到Spring

框架/平台构成:

Maven+Springmvc + Mybatis + Shiro(权限)+ Tiles(模板) +ActiveMQ(消息队列) + Rest(服务) + WebService(服务)+ EHcache(缓存) + Quartz(定时调度)+ Html5(支持PC、IOS、Android)

用户权限系统:

组织结构:角色、用户、用户组、组织机构;权限点:页面、方法、按钮、数据权限、分级授权

项目管理新体验:

快速出原型系统、组件树、版本控制、模块移植、协同开发、实时监控、发布管理

可持续集成:

所有组件可移植、可定制、可扩充,开发成果不断积累,形成可持续发展的良性循环

支持平台平台:

Windows XP、Windows 7 、Windows 10 、 Linux 、 Unix

服务器容器:

Tomcat 5/6/7 、Jetty、JBoss、WebSphere 8.5

上一篇下一篇

猜你喜欢

热点阅读