springmvc+mybatis怎么傳值到xml【轉(zhuǎn)】

直接上代碼? 首先是從程序的入口開始說:

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

設(shè)置session過期的時間

讀取spring的配置文件

-->

contextConfigLocation

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

org.springframework.web.context.ContextLoaderListener

org.springframework.web.util.IntrospectorCleanupListener

設(shè)置字符編碼,將所有的字符編碼同意設(shè)置為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

框架/平臺構(gòu)成:

Maven+Springmvc + Mybatis + Shiro(權(quán)限)+ Tiles(模板) +ActiveMQ(消息隊列) + Rest(服務(wù)) + WebService(服務(wù))+ EHcache(緩存) + Quartz(定時調(diào)度)+ Html5(支持PC、IOS、Android)

用戶權(quán)限系統(tǒng):

組織結(jié)構(gòu):角色、用戶、用戶組、組織機構(gòu);權(quán)限點:頁面、方法、按鈕、數(shù)據(jù)權(quán)限、分級授權(quán)

項目管理新體驗:

快速出原型系統(tǒng)、組件樹、版本控制、模塊移植、協(xié)同開發(fā)、實時監(jiān)控、發(fā)布管理

可持續(xù)集成:

所有組件可移植、可定制、可擴充,開發(fā)成果不斷積累,形成可持續(xù)發(fā)展的良性循環(huán)

支持平臺平臺:

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

服務(wù)器容器:

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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容