1. 程式人生 > >springMVC框架搭建

springMVC框架搭建

VC jni fib dbd efk dpa gmm jti F5

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">

    <filter>
        <filter-name
>characterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </
init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/springMVC-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>/page/index.html</welcome-file> </welcome-file-list> <!-- Spring 加載配置文件 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext*.xml</param-value> </context-param> </web-app>

好久不寫博客了,轉眼都工作一年了。而到現在,才開始想要去了解了解spring的搭建及原理。

首先我搭建好的項目結構如圖:

技術分享圖片

1、新建一個動態網站項目。

2、在WEB-INF/lib下導入jar包,關於jar包具體有哪些,具體用那些還沒做研究,只是簡單的copy過來了如下一坨:

技術分享圖片

然後build path。

3、在WEB-INF下寫一個web.xml

sdfsf

springMVC框架搭建