web.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
  4. metadata-complete="false" version="3.1">
  5. <!-- ===================================================================== -->
  6. <!-- This file contains the default descriptor for web applications. -->
  7. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8. - -->
  9. <!-- The intent of this descriptor is to include jetty specific or common -->
  10. <!-- configuration for all webapps. If a context has a webdefault.xml -->
  11. <!-- descriptor, it is applied before the context's own web.xml file -->
  12. <!-- -->
  13. <!-- A context may be assigned a default descriptor by calling -->
  14. <!-- WebAppContext.setDefaultsDescriptor(String). -->
  15. <!-- -->
  16. <!-- This file is present in the jetty-webapp.jar, and is used as the -->
  17. <!-- defaults descriptor if no other is explicitly set on a context. -->
  18. <!-- -->
  19. <!-- A copy of this file is also placed into the $JETTY_HOME/etc dir of -->
  20. <!-- the distribution, and is referenced by some of the other xml files, -->
  21. <!-- eg the jetty-deploy.xml file. -->
  22. <!-- ===================================================================== -->
  23. <description>
  24. Default web.xml file.
  25. This file is applied to a Web application before it's own WEB_INF/web.xml file
  26. </description>
  27. <!-- ==================================================================== -->
  28. <!-- Removes static references to beans from javax.el.BeanELResolver to -->
  29. <!-- ensure webapp classloader can be released on undeploy -->
  30. <!-- ==================================================================== -->
  31. <listener>
  32. <listener-class>org.eclipse.jetty.servlet.listener.ELContextCleaner</listener-class>
  33. </listener>
  34. <!-- ==================================================================== -->
  35. <!-- Removes static cache of Methods from java.beans.Introspector to -->
  36. <!-- ensure webapp classloader can be released on undeploy -->
  37. <!-- ==================================================================== -->
  38. <listener>
  39. <listener-class>org.eclipse.jetty.servlet.listener.IntrospectorCleaner</listener-class>
  40. </listener>
  41. <!-- ==================================================================== -->
  42. <!-- Context params to control Session Cookies -->
  43. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  44. <!-- UNCOMMENT TO ACTIVATE <context-param> <param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
  45. <param-value>127.0.0.1</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
  46. <param-value>/</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
  47. <param-value>-1</param-value> </context-param> -->
  48. <!-- ==================================================================== -->
  49. <!-- The default servlet. -->
  50. <!-- This servlet, normally mapped to /, provides the handling for static -->
  51. <!-- content, OPTIONS and TRACE methods for the context. -->
  52. <!-- The following initParameters are supported: -->
  53. <!-- * acceptRanges If true, range requests and responses are * supported
  54. * * dirAllowed If true, directory listings are returned if no * welcome file
  55. is found. Else 403 Forbidden. * * welcomeServlets If true, attempt to dispatch
  56. to welcome files * that are servlets, but only after no matching static *
  57. resources could be found. If false, then a welcome * file must exist on disk.
  58. If "exact", then exact * servlet matches are supported without an existing
  59. file. * Default is true. * * This must be false if you want directory listings,
  60. * but have index.jsp in your welcome file list. * * redirectWelcome If true,
  61. welcome files are redirected rather than * forwarded to. * * gzip If set
  62. to true, then static content will be served as * gzip content encoded if
  63. a matching resource is * found ending with ".gz" * * resourceBase Set to
  64. replace the context resource base * * resourceCache If set, this is a context
  65. attribute name, which the servlet * will use to look for a shared ResourceCache
  66. instance. * * relativeResourceBase * Set with a pathname relative to the
  67. base of the * servlet context root. Useful for only serving static content
  68. out * of only specific subdirectories. * * pathInfoOnly If true, only the
  69. path info will be applied to the resourceBase * * stylesheet Set with the
  70. location of an optional stylesheet that will be used * to decorate the directory
  71. listing html. * * aliases If True, aliases of resources are allowed (eg.
  72. symbolic * links and caps variations). May bypass security constraints. *
  73. * etags If True, weak etags will be generated and handled. * * maxCacheSize
  74. The maximum total size of the cache or 0 for no cache. * maxCachedFileSize
  75. The maximum size of a file to cache * maxCachedFiles The maximum number of
  76. files to cache * * useFileMappedBuffer * If set to true, it will use mapped
  77. file buffers to serve static content * when using an NIO connector. Setting
  78. this value to false means that * a direct buffer will be used instead of
  79. a mapped file buffer. * This file sets the value to true. * * cacheControl
  80. If set, all static content will have this value set as the cache-control
  81. * header. * -->
  82. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  83. <servlet>
  84. <servlet-name>default</servlet-name>
  85. <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
  86. <init-param>
  87. <param-name>aliases</param-name>
  88. <param-value>false</param-value>
  89. </init-param>
  90. <init-param>
  91. <param-name>acceptRanges</param-name>
  92. <param-value>true</param-value>
  93. </init-param>
  94. <init-param>
  95. <param-name>dirAllowed</param-name>
  96. <param-value>true</param-value>
  97. </init-param>
  98. <init-param>
  99. <param-name>welcomeServlets</param-name>
  100. <param-value>false</param-value>
  101. </init-param>
  102. <init-param>
  103. <param-name>redirectWelcome</param-name>
  104. <param-value>false</param-value>
  105. </init-param>
  106. <init-param>
  107. <param-name>maxCacheSize</param-name>
  108. <param-value>256000000</param-value>
  109. </init-param>
  110. <init-param>
  111. <param-name>maxCachedFileSize</param-name>
  112. <param-value>200000000</param-value>
  113. </init-param>
  114. <init-param>
  115. <param-name>maxCachedFiles</param-name>
  116. <param-value>2048</param-value>
  117. </init-param>
  118. <init-param>
  119. <param-name>gzip</param-name>
  120. <param-value>false</param-value>
  121. </init-param>
  122. <init-param>
  123. <param-name>etags</param-name>
  124. <param-value>false</param-value>
  125. </init-param>
  126. <init-param>
  127. <param-name>useFileMappedBuffer</param-name>
  128. <param-value>true</param-value>
  129. </init-param>
  130. <!-- <init-param> <param-name>resourceCache</param-name> <param-value>resourceCache</param-value>
  131. </init-param> -->
  132. <!-- <init-param> <param-name>cacheControl</param-name> <param-value>max-age=3600,public</param-value>
  133. </init-param> -->
  134. <load-on-startup>0</load-on-startup>
  135. </servlet>
  136. <servlet-mapping>
  137. <servlet-name>default</servlet-name>
  138. <url-pattern>/</url-pattern>
  139. </servlet-mapping>
  140. <!-- ==================================================================== -->
  141. <!-- JSP Servlet -->
  142. <!-- This is the jasper JSP servlet. -->
  143. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  144. <!-- The JSP page compiler and execution servlet, which is the mechanism -->
  145. <!-- used by the jsp container to support JSP pages. Traditionally, -->
  146. <!-- this servlet is mapped to URL pattern "*.jsp". This servlet -->
  147. <!-- supports the following initialization parameters (default values -->
  148. <!-- are in square brackets): -->
  149. <!-- -->
  150. <!-- checkInterval If development is false and reloading is true, -->
  151. <!-- background compiles are enabled. checkInterval -->
  152. <!-- is the time in seconds between checks to see -->
  153. <!-- if a JSP page needs to be recompiled. [300] -->
  154. <!-- -->
  155. <!-- compiler Which compiler Ant should use to compile JSP -->
  156. <!-- pages. See the Ant documentation for more -->
  157. <!-- information. [javac] -->
  158. <!-- -->
  159. <!-- classdebuginfo Should the class file be compiled with -->
  160. <!-- debugging information? [true] -->
  161. <!-- -->
  162. <!-- classpath What class path should I use while compiling -->
  163. <!-- generated servlets? [Created dynamically -->
  164. <!-- based on the current web application] -->
  165. <!-- Set to ? to make the container explicitly set -->
  166. <!-- this parameter. -->
  167. <!-- -->
  168. <!-- development Is Jasper used in development mode (will check -->
  169. <!-- for JSP modification on every access)? [true] -->
  170. <!-- -->
  171. <!-- enablePooling Determines whether tag handler pooling is -->
  172. <!-- enabled [true] -->
  173. <!-- -->
  174. <!-- fork Tell Ant to fork compiles of JSP pages so that -->
  175. <!-- a separate JVM is used for JSP page compiles -->
  176. <!-- from the one Tomcat is running in. [true] -->
  177. <!-- -->
  178. <!-- ieClassId The class-id value to be sent to Internet -->
  179. <!-- Explorer when using <jsp:plugin> tags. -->
  180. <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
  181. <!-- -->
  182. <!-- javaEncoding Java file encoding to use for generating java -->
  183. <!-- source files. [UTF-8] -->
  184. <!-- -->
  185. <!-- keepgenerated Should we keep the generated Java source code -->
  186. <!-- for each page instead of deleting it? [true] -->
  187. <!-- -->
  188. <!-- logVerbosityLevel The level of detailed messages to be produced -->
  189. <!-- by this servlet. Increasing levels cause the -->
  190. <!-- generation of more messages. Valid values are -->
  191. <!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
  192. <!-- [WARNING] -->
  193. <!-- -->
  194. <!-- mappedfile Should we generate static content with one -->
  195. <!-- print statement per input line, to ease -->
  196. <!-- debugging? [false] -->
  197. <!-- -->
  198. <!-- -->
  199. <!-- reloading Should Jasper check for modified JSPs? [true] -->
  200. <!-- -->
  201. <!-- suppressSmap Should the generation of SMAP info for JSR45 -->
  202. <!-- debugging be suppressed? [false] -->
  203. <!-- -->
  204. <!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
  205. <!-- dumped to a file? [false] -->
  206. <!-- False if suppressSmap is true -->
  207. <!-- -->
  208. <!-- scratchdir What scratch directory should we use when -->
  209. <!-- compiling JSP pages? [default work directory -->
  210. <!-- for the current web application] -->
  211. <!-- -->
  212. <!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
  213. <!-- -->
  214. <!-- xpoweredBy Determines whether X-Powered-By response -->
  215. <!-- header is added by generated servlet [false] -->
  216. <!-- -->
  217. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  218. <servlet id="jsp">
  219. <servlet-name>jsp</servlet-name>
  220. <servlet-class>org.eclipse.jetty.jsp.JettyJspServlet</servlet-class>
  221. <init-param>
  222. <param-name>logVerbosityLevel</param-name>
  223. <param-value>DEBUG</param-value>
  224. </init-param>
  225. <init-param>
  226. <param-name>fork</param-name>
  227. <param-value>false</param-value>
  228. </init-param>
  229. <init-param>
  230. <param-name>xpoweredBy</param-name>
  231. <param-value>false</param-value>
  232. </init-param>
  233. <init-param>
  234. <param-name>compilerTargetVM</param-name>
  235. <param-value>1.7</param-value>
  236. </init-param>
  237. <init-param>
  238. <param-name>compilerSourceVM</param-name>
  239. <param-value>1.7</param-value>
  240. </init-param>
  241. <!-- <init-param> <param-name>classpath</param-name> <param-value>?</param-value>
  242. </init-param> -->
  243. <load-on-startup>0</load-on-startup>
  244. </servlet>
  245. <servlet-mapping>
  246. <servlet-name>jsp</servlet-name>
  247. <url-pattern>*.jsp</url-pattern>
  248. <url-pattern>*.jspf</url-pattern>
  249. <url-pattern>*.jspx</url-pattern>
  250. <url-pattern>*.xsp</url-pattern>
  251. <url-pattern>*.JSP</url-pattern>
  252. <url-pattern>*.JSPF</url-pattern>
  253. <url-pattern>*.JSPX</url-pattern>
  254. <url-pattern>*.XSP</url-pattern>
  255. </servlet-mapping>
  256. <!-- ==================================================================== -->
  257. <!-- Default session configuration -->
  258. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  259. <session-config>
  260. <session-timeout>30</session-timeout>
  261. </session-config>
  262. <!-- ==================================================================== -->
  263. <!-- Default MIME mappings -->
  264. <!-- The default MIME mappings are provided by the mime.properties -->
  265. <!-- resource in the jetty-http.jar file. Additional or modified -->
  266. <!-- mappings may be specified here -->
  267. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  268. <!-- UNCOMMENT TO ACTIVATE <mime-mapping> <extension>mysuffix</extension>
  269. <mime-type>mymime/type</mime-type> </mime-mapping> -->
  270. <!-- ==================================================================== -->
  271. <!-- Default welcome files -->
  272. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  273. <welcome-file-list>
  274. <welcome-file>index.html</welcome-file>
  275. <welcome-file>index.htm</welcome-file>
  276. <welcome-file>index.jsp</welcome-file>
  277. </welcome-file-list>
  278. <!-- ==================================================================== -->
  279. <!-- Default locale encodings -->
  280. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  281. <locale-encoding-mapping-list>
  282. <locale-encoding-mapping>
  283. <locale>ar</locale>
  284. <encoding>ISO-8859-6</encoding>
  285. </locale-encoding-mapping>
  286. <locale-encoding-mapping>
  287. <locale>be</locale>
  288. <encoding>ISO-8859-5</encoding>
  289. </locale-encoding-mapping>
  290. <locale-encoding-mapping>
  291. <locale>bg</locale>
  292. <encoding>ISO-8859-5</encoding>
  293. </locale-encoding-mapping>
  294. <locale-encoding-mapping>
  295. <locale>ca</locale>
  296. <encoding>ISO-8859-1</encoding>
  297. </locale-encoding-mapping>
  298. <locale-encoding-mapping>
  299. <locale>cs</locale>
  300. <encoding>ISO-8859-2</encoding>
  301. </locale-encoding-mapping>
  302. <locale-encoding-mapping>
  303. <locale>da</locale>
  304. <encoding>ISO-8859-1</encoding>
  305. </locale-encoding-mapping>
  306. <locale-encoding-mapping>
  307. <locale>de</locale>
  308. <encoding>ISO-8859-1</encoding>
  309. </locale-encoding-mapping>
  310. <locale-encoding-mapping>
  311. <locale>el</locale>
  312. <encoding>ISO-8859-7</encoding>
  313. </locale-encoding-mapping>
  314. <locale-encoding-mapping>
  315. <locale>en</locale>
  316. <encoding>ISO-8859-1</encoding>
  317. </locale-encoding-mapping>
  318. <locale-encoding-mapping>
  319. <locale>es</locale>
  320. <encoding>ISO-8859-1</encoding>
  321. </locale-encoding-mapping>
  322. <locale-encoding-mapping>
  323. <locale>et</locale>
  324. <encoding>ISO-8859-1</encoding>
  325. </locale-encoding-mapping>
  326. <locale-encoding-mapping>
  327. <locale>fi</locale>
  328. <encoding>ISO-8859-1</encoding>
  329. </locale-encoding-mapping>
  330. <locale-encoding-mapping>
  331. <locale>fr</locale>
  332. <encoding>ISO-8859-1</encoding>
  333. </locale-encoding-mapping>
  334. <locale-encoding-mapping>
  335. <locale>hr</locale>
  336. <encoding>ISO-8859-2</encoding>
  337. </locale-encoding-mapping>
  338. <locale-encoding-mapping>
  339. <locale>hu</locale>
  340. <encoding>ISO-8859-2</encoding>
  341. </locale-encoding-mapping>
  342. <locale-encoding-mapping>
  343. <locale>is</locale>
  344. <encoding>ISO-8859-1</encoding>
  345. </locale-encoding-mapping>
  346. <locale-encoding-mapping>
  347. <locale>it</locale>
  348. <encoding>ISO-8859-1</encoding>
  349. </locale-encoding-mapping>
  350. <locale-encoding-mapping>
  351. <locale>iw</locale>
  352. <encoding>ISO-8859-8</encoding>
  353. </locale-encoding-mapping>
  354. <locale-encoding-mapping>
  355. <locale>ja</locale>
  356. <encoding>Shift_JIS</encoding>
  357. </locale-encoding-mapping>
  358. <locale-encoding-mapping>
  359. <locale>ko</locale>
  360. <encoding>EUC-KR</encoding>
  361. </locale-encoding-mapping>
  362. <locale-encoding-mapping>
  363. <locale>lt</locale>
  364. <encoding>ISO-8859-2</encoding>
  365. </locale-encoding-mapping>
  366. <locale-encoding-mapping>
  367. <locale>lv</locale>
  368. <encoding>ISO-8859-2</encoding>
  369. </locale-encoding-mapping>
  370. <locale-encoding-mapping>
  371. <locale>mk</locale>
  372. <encoding>ISO-8859-5</encoding>
  373. </locale-encoding-mapping>
  374. <locale-encoding-mapping>
  375. <locale>nl</locale>
  376. <encoding>ISO-8859-1</encoding>
  377. </locale-encoding-mapping>
  378. <locale-encoding-mapping>
  379. <locale>no</locale>
  380. <encoding>ISO-8859-1</encoding>
  381. </locale-encoding-mapping>
  382. <locale-encoding-mapping>
  383. <locale>pl</locale>
  384. <encoding>ISO-8859-2</encoding>
  385. </locale-encoding-mapping>
  386. <locale-encoding-mapping>
  387. <locale>pt</locale>
  388. <encoding>ISO-8859-1</encoding>
  389. </locale-encoding-mapping>
  390. <locale-encoding-mapping>
  391. <locale>ro</locale>
  392. <encoding>ISO-8859-2</encoding>
  393. </locale-encoding-mapping>
  394. <locale-encoding-mapping>
  395. <locale>ru</locale>
  396. <encoding>ISO-8859-5</encoding>
  397. </locale-encoding-mapping>
  398. <locale-encoding-mapping>
  399. <locale>sh</locale>
  400. <encoding>ISO-8859-5</encoding>
  401. </locale-encoding-mapping>
  402. <locale-encoding-mapping>
  403. <locale>sk</locale>
  404. <encoding>ISO-8859-2</encoding>
  405. </locale-encoding-mapping>
  406. <locale-encoding-mapping>
  407. <locale>sl</locale>
  408. <encoding>ISO-8859-2</encoding>
  409. </locale-encoding-mapping>
  410. <locale-encoding-mapping>
  411. <locale>sq</locale>
  412. <encoding>ISO-8859-2</encoding>
  413. </locale-encoding-mapping>
  414. <locale-encoding-mapping>
  415. <locale>sr</locale>
  416. <encoding>ISO-8859-5</encoding>
  417. </locale-encoding-mapping>
  418. <locale-encoding-mapping>
  419. <locale>sv</locale>
  420. <encoding>ISO-8859-1</encoding>
  421. </locale-encoding-mapping>
  422. <locale-encoding-mapping>
  423. <locale>tr</locale>
  424. <encoding>ISO-8859-9</encoding>
  425. </locale-encoding-mapping>
  426. <locale-encoding-mapping>
  427. <locale>uk</locale>
  428. <encoding>ISO-8859-5</encoding>
  429. </locale-encoding-mapping>
  430. <locale-encoding-mapping>
  431. <locale>zh</locale>
  432. <encoding>GB2312</encoding>
  433. </locale-encoding-mapping>
  434. <locale-encoding-mapping>
  435. <locale>zh_TW</locale>
  436. <encoding>Big5</encoding>
  437. </locale-encoding-mapping>
  438. </locale-encoding-mapping-list>
  439. <!-- ==================================================================== -->
  440. <!-- Disable TRACE method with security constraint -->
  441. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  442. <security-constraint>
  443. <web-resource-collection>
  444. <web-resource-name>Disable TRACE</web-resource-name>
  445. <url-pattern>/</url-pattern>
  446. <http-method>TRACE</http-method>
  447. </web-resource-collection>
  448. <auth-constraint />
  449. </security-constraint>
  450. <security-constraint>
  451. <web-resource-collection>
  452. <web-resource-name>Enable everything but TRACE</web-resource-name>
  453. <url-pattern>/</url-pattern>
  454. <http-method-omission>TRACE</http-method-omission>
  455. </web-resource-collection>
  456. </security-constraint>
  457. <servlet>
  458. <servlet-name>DruidStatView</servlet-name>
  459. <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
  460. </servlet>
  461. <servlet-mapping>
  462. <servlet-name>DruidStatView</servlet-name>
  463. <url-pattern>/druid/*</url-pattern>
  464. </servlet-mapping>
  465. <filter>
  466. <filter-name>DruidWebStatFilter</filter-name>
  467. <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
  468. <init-param>
  469. <param-name>exclusions</param-name>
  470. <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
  471. </init-param>
  472. </filter>
  473. <filter-mapping>
  474. <filter-name>DruidWebStatFilter</filter-name>
  475. <url-pattern>/*</url-pattern>
  476. </filter-mapping>
  477. <filter>
  478. <filter-name>cross-origin</filter-name>
  479. <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
  480. <init-param>
  481. <param-name>allowedOrigins</param-name>
  482. <param-value>*</param-value>
  483. </init-param>
  484. <init-param>
  485. <param-name>allowedMethods</param-name>
  486. <param-value>*</param-value>
  487. </init-param>
  488. <init-param>
  489. <param-name>allowedHeaders</param-name>
  490. <param-value>*</param-value>
  491. </init-param>
  492. </filter>
  493. <filter-mapping>
  494. <filter-name>cross-origin</filter-name>
  495. <url-pattern>/*</url-pattern>
  496. </filter-mapping>
  497. </web-app>