ITeye博客

在web.xml中配置一个servlet

bd2007 · 2011-08-04 09:42 · java · 编程语言 · Markdown

<?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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"	xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"	id="webapp_id" version="2.5">	<display-name>student</display-name>	<welcome-file-list>		<welcome-file>index.html</welcome-file>		<welcome-file>index.htm</welcome-file>		<welcome-file>index.jsp</welcome-file>		<welcome-file>default.html</welcome-file>		<welcome-file>default.htm</welcome-file>		<welcome-file>default.jsp</welcome-file>	</welcome-file-list>	<servlet>		<servlet-name>test</servlet-name>		<servlet-class>com.test.test</servlet-class>		<load-on-startup>1</load-on-startup>	</servlet>	<servlet-mapping>		<servlet-name>test</servlet-name>		<url-pattern>/test</url-pattern>	</servlet-mapping></web-app>

testservlet的名称 com.test.testservlet的类全称(包名.类名) 1是否在服务器启动时就加载,如果不用在服务器启动时就加载可以去掉此项 /testservlet的访问路径

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。