SpringMVC - Tips

Keywords:springmvc, maven, sonatype nexus

IDE:Myeclipse

项目结构概览


Tips:

sonatype nexus界面
pom.xml

一、pom.xml添加<dependencies>,完成jar包的添加。

springmvc主要涉及:spring-core、spring-beans、spring-web、spring-context、spring-context-support、spring-webmvc、spring-tx(事务)、spring-orm、spring-jdbc、spring-aop等,根据需要添加jar包。

maven -jars

二、配置文件。

配置文件

      1、web.xml:

           ——注意多个xml文件用“,”相隔

      2、spring-basic.xml(配置spring)

spring-basic.xml

      3、spring-mvc.xml(配置mvc)

          —— “注意配置自动注入”

spring-mvc.xml

      4、spring-jdbc.xml

           图中红色标记区域为“数据库连接池”,常用连接池有:C3P0, DBCP, Bonecp, Proxool。

           此处选择DBCP,并且需要导入相关jar包。

spring-jdbc.xml
DBCP所需的common相关jar包
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容