html5/css教程

javascript教程

asp教程

php教程

jsp教程

C#/.NET教程

Python教程

网络营销

建站经验

点击排行

您现在的位置:首页 > 网络教程 > jsp框架

Spring MVC 框架搭建配置步骤

来源:中文源码网    浏览:553 次    日期:2024-04-19 02:38:07

第一步:Spring MVC环境搭建:(Spring 2.5.6 + Hibernate 3.2.0)

1. jar包引入

Spring 2.5.6:spring.jar、spring-webmvc.jar、commons-logging.jar、cglib-nodep-2.1_3.jar

Hibernate 3.6.8:hibernate3.jar、hibernate-jpa-2.0-api-1.0.1.Final.jar、antlr-2.7.6.jar、commons-collections-3.1、dom4j-1.6.1.jar、javassist-3.12.0.GA.jar、jta-1.1.jar、slf4j-api-1.6.1.jar、slf4j-nop-1.6.4.jar、相应数据库的驱动jar包


第二步: web.xml配置

    spring    org.springframework.web.servlet.DispatcherServlet      1           spring    *.do                  org.springframework.web.context.ContextLoaderListener               contextConfigLocation    classpath:config/applicationContext.xml  
第三步:ring-servlet.xml配置
spring-servlet这个名字是因为上面web.xml中标签配的值为spring(spring),再加上“-servlet”后缀而形成的spring-servlet.xml文件名,如果改为springMVC,对应的文件名则为springMVC-servlet.xml。
  http://www.springframework.org/schema/context/spring-context-3.0.xsd">                                      

第四步:applicationContext.xml配置



  
  
    
      classpath:config/hibernate.cfg.xml
  
  
  
    
      
  
  
  
  
  
  
  
    
  


精彩推荐