分享
 
 
 

标准的web.xml(Tomcat)

王朝system·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app

PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<!-- General description of your web application -->

<display-name>My Web Application</display-name>

<description>

This is version X.X of an application to perform

a wild and wonderful task, based on servlets and

JSP pages. It was written by Dave Developer

(dave@mycompany.com), who should be contacted for

more information.

</description>

<!-- Context initialization parameters that define shared

String constants used within your application, which

can be customized by the system administrator who is

installing your application. The values actually

assigned to these parameters can be retrieved in a

servlet or JSP page by calling:

String value =

getServletContext().getInitParameter("name");

where "name" matches the <param-name> element of

one of these initialization parameters.

You can define any number of context initialization

parameters, including zero.

-->

<context-param>

<param-name>webmaster</param-name>

<param-value>myaddress@mycompany.com</param-value>

<description>

The EMAIL address of the administrator to whom questions

and comments about this application should be addressed.

</description>

</context-param>

<!-- Servlet definitions for the servlets that make up

your web application, including initialization

parameters. With Tomcat, you can also send requests

to servlets not listed here with a request like this:

http://localhost:8080/{context-path}/servlet/{classname}

but this usage is not guaranteed to be portable. It also

makes relative references to images and other resources

required by your servlet more complicated, so defining

all of your servlets (and defining a mapping to them with

a servlet-mapping element) is recommended.

Servlet initialization parameters can be retrieved in a

servlet or JSP page by calling:

String value =

getServletConfig().getInitParameter("name");

where "name" matches the <param-name> element of

one of these initialization parameters.

You can define any number of servlets, including zero.

-->

<servlet>

<servlet-name>controller</servlet-name>

<description>

This servlet plays the "controller" role in the MVC architecture

used in this application. It is generally mapped to the ".do"

filename extension with a servlet-mapping element, and all form

submits in the app will be submitted to a request URI like

"saveCustomer.do", which will therefore be mapped to this servlet.

The initialization parameter namess for this servlet are the

"servlet path" that will be received by this servlet (after the

filename extension is removed). The corresponding value is the

name of the action class that will be used to process this request.

</description>

<servlet-class>com.mycompany.mypackage.ControllerServlet</servlet-class>

<init-param>

<param-name>listOrders</param-name>

<param-value>com.mycompany.myactions.ListOrdersAction</param-value>

</init-param>

<init-param>

<param-name>saveCustomer</param-name>

<param-value>com.mycompany.myactions.SaveCustomerAction</param-value>

</init-param>

<!-- Load this servlet at server startup time -->

<load-on-startup>5</load-on-startup>

</servlet>

<servlet>

<servlet-name>graph</servlet-name>

<description>

This servlet produces GIF images that are dynamically generated

graphs, based on the input parameters included on the request.

It is generally mapped to a specific request URI like "/graph".

</description>

</servlet>

<!-- Define mappings that are used by the servlet container to

translate a particular request URI (context-relative) to a

particular servlet. The examples below correspond to the

servlet descriptions above. Thus, a request URI like:

http://localhost:8080/{contextpath}/graph

will be mapped to the "graph" servlet, while a request like:

http://localhost:8080/{contextpath}/saveCustomer.do

will be mapped to the "controller" servlet.

You may define any number of servlet mappings, including zero.

It is also legal to define more than one mapping for the same

servlet, if you wish to.

-->

<servlet-mapping>

<servlet-name>controller</servlet-name>

<url-pattern>*.do</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>graph</servlet-name>

<url-pattern>/graph</url-pattern>

</servlet-mapping>

<!-- Define the default session timeout for your application,

in minutes. From a servlet or JSP page, you can modify

the timeout for a particular session dynamically by using

HttpSession.getMaxInactiveInterval(). -->

<session-config>

<session-timeout>30</session-timeout> <!-- 30 minutes -->

</session-config>

</web-app>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有