<? 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/j2ee"
xmlns:web = "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version = "2.4" >
< display-name >OSChina.NET</ display-name >
<!-- filters -->
< filter >
< filter-name >global</ filter-name >
< filter-class >net.oschina.OSChinaFilter</ filter-class >
</ filter >
< filter >
< filter-name >myspace</ filter-name >
< filter-class >net.oschina.MySpaceFilter</ filter-class >
< init-param >
< param-name >domain</ param-name >
< param-value >my.oschina.net</ param-value >
</ init-param >
</ filter >
< filter-mapping >
< filter-name >global</ filter-name >
< url-pattern >/*</ url-pattern >
</ filter-mapping >
< filter-mapping >
< filter-name >myspace</ filter-name >
< url-pattern >/*</ url-pattern >
</ filter-mapping >
<!-- servlets -->
< servlet >
< servlet-name >velocity</ servlet-name >
< servlet-class >my.view.VelocityServlet</ servlet-class >
< init-param >
< param-name >org.apache.velocity.toolbox</ param-name >
< param-value >/WEB-INF/conf/velocity-toolbox.xml</ param-value >
</ init-param >
< init-param >
< param-name >org.apache.velocity.properties</ param-name >
< param-value >/WEB-INF/conf/velocity.properties</ param-value >
</ init-param >
< load-on-startup >1</ load-on-startup >
</ servlet >
< servlet >
< servlet-name >controller</ servlet-name >
< servlet-class >my.mvc.ActionServlet</ servlet-class >
< init-param >
< param-name >packages</ param-name >
<!-- 多个包请用逗号隔开 -->
< param-value >net.oschina.action</ param-value >
</ init-param >
< init-param >
< param-name >initial_actions</ param-name >
<!-- 多个类请用逗号隔开 -->
< param-value >visit</ param-value >
</ init-param >
< load-on-startup >2</ load-on-startup >
</ servlet >
< servlet >
< servlet-name >mapping</ servlet-name >
< servlet-class >my.view.URLMappingServlet</ servlet-class >
< init-param > <!-- WAP页面路径 -->
< param-name >wap</ param-name >
< param-value >/WEB-INF/wap/</ param-value >
</ init-param >
< init-param > <!-- WAP页面路径 -->
< param-name >m</ param-name >
< param-value >/WEB-INF/wap/</ param-value >
</ init-param >
< init-param > <!-- CSDN合作频道页面路径 -->
< param-name >opensource.csdn.net</ param-name >
< param-value >/WEB-INF/csdn/</ param-value >
</ init-param >
< init-param > <!-- CSDN合作频道页面路径 -->
< param-name >csdn</ param-name >
< param-value >/WEB-INF/csdn/</ param-value >
</ init-param >
< init-param > <!-- WEB页面路径 -->
< param-name >default</ param-name >
< param-value >/WEB-INF/www/</ param-value >
</ init-param >
< init-param >
< param-name >myspace</ param-name >
< param-value >/WEB-INF/myspace/</ param-value >
</ init-param >
< load-on-startup >3</ load-on-startup >
</ servlet >
< servlet-mapping >
< servlet-name >velocity</ servlet-name >
< url-pattern >*.vm</ url-pattern >
</ servlet-mapping >
< servlet-mapping >
< servlet-name >velocity</ servlet-name >
< url-pattern >/sitemap.xml</ url-pattern >
</ servlet-mapping >
< servlet-mapping >
< servlet-name >controller</ servlet-name >
< url-pattern >/action/*</ url-pattern >
</ servlet-mapping >
< servlet-mapping >
< servlet-name >mapping</ servlet-name >
< url-pattern >/home/*</ url-pattern >
<!-- 首页 -->
< url-pattern >/shop/*</ url-pattern >
<!-- 团购 -->
< url-pattern >/user/*</ url-pattern >
<!-- 用户页 -->
< url-pattern >/project/*</ url-pattern >
<!-- 项目页 -->
< url-pattern >/p/*</ url-pattern >
< url-pattern >/blog/*</ url-pattern >
<!-- 博客频道 -->
< url-pattern >/news/*</ url-pattern >
<!-- 新闻频道 -->
< url-pattern >/bbs/*</ url-pattern >
< url-pattern >/code/*</ url-pattern >
<!-- Code Snipplet-->
< url-pattern >/help/*</ url-pattern >
< url-pattern >/widgets/*</ url-pattern >
<!-- Widgets -->
< url-pattern >/admin/*</ url-pattern >
<!-- 管理页 -->
</ servlet-mapping >
<!-- servlet config -->
< session-config >
< session-timeout >30</ session-timeout >
</ session-config >
< welcome-file-list >
< welcome-file >index.vm</ welcome-file >
< welcome-file >index.html</ welcome-file >
</ welcome-file-list >
< error-page >
< error-code >403</ error-code >
< location >/403.html</ location >
</ error-page >
< error-page >
< error-code >404</ error-code >
< location >/404.vm</ location >
</ error-page >
< error-page >
< error-code >500</ error-code >
< location >/500.vm</ location >
</ error-page >
</ web-app >
|