Required Configuration

You need to map requests that you want the DispatcherServlet to handle, by using a URL mapping in the web.xml file. The following is an example to show declaration and mapping

for HelloWebDispatcherServlet example:

<web-app id="WebApp_ID" version="2.4"
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">
    <display-name>Spring MVC Application</display-name>
   <servlet>
<servlet-name>HelloWeb</servlet-name>
<servlet-class>
         org.springframework.web.servlet.DispatcherServlet
      </servlet-class>
      <load-on-startup>1</load-on-startup>
</servlet>
   <servlet-mapping>
<servlet-name>HelloWeb</servlet-name>
<url-pattern>*.jsp</url-pattern>
   </servlet-mapping>
</web-app>

The web.xml file will be kept WebContent/WEB-INF directory of your web application. OK, upon initialization of HelloWeb DispatcherServlet, the framework will try to load the application context from a file named [servlet-name]-servlet.xml located in the application's WebContent/WEB- INF directory. In this case our file will be HelloWeb-servlet.xml.

 
 

最新文章

  1. ubuntu中查看已有的mysql用户并修改用户名和密码
  2. jQuery Mobile入门
  3. C语言 &#183; 回文数
  4. Web Essentials之HTML和CSS操作技巧
  5. 使用mx:Repeater在删除和添加item时列表闪烁
  6. C++ Primer : 第十章 : 泛型算法 之 只读、写和排序算法
  7. Hadoop学习1--解决启动过程中的问题
  8. (转)价值240万的photoshop中文教程,错过了后悔都来不及 (吹得好响)
  9. FileUtils
  10. eclipse新建workspace使用之前workspace的个性配置
  11. 第四组UI组件:AdapterView及子类
  12. linux下keepalived 安装配置
  13. 2015 多校联赛 ——HDU5325(DFS)
  14. [Swift]扩展String类:Base64的编码和解码
  15. JS_高程5.引用类型(3)Array类型-检测数组
  16. linux如何查看端口被哪个进程占用
  17. 鸟哥的Linux私房菜——第九章
  18. SearchBySql
  19. maven 知识点2
  20. hdu 4417,poj 2104 划分树(模版)归并树(模版)

热门文章

  1. 微信公众号与HTML 5混合模式揭秘1——如何部署JSSDK
  2. 杭电ACM2061--Treasure the new start, freshmen!
  3. BZOJ 1631==USACO 2007== POJ 3268 Cow Party奶牛派对
  4. sicily 1027 MJ, Nowhere to Hide 字符串匹配与排序
  5. Mentor PADS 9.5下载安装及破解指南
  6. Linux5.8下安装PhpMyadmin无法关联php-mcrypt问题
  7. JAVA多线程学习--哲学家就餐问题
  8. php 文件上传简单类---限制仅上传jpg文件
  9. hdu 5545 The Battle of Guandu spfa最短路
  10. 数据分析≠Hadoop+NoSQL,不妨先看完善现有技术的10条捷径(分享)