如何配置web.xml才能访问我编写的类文件啊

疯雪 2015-09-05 07:53:56


<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">


<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<!--ip Filter
<filter>
<filter-name>FilterDemo24</filter-name>
<filter-class>com.tomcat.web.FilterDemo24</filter-class>
<init-param>
<param-name>ip</param-name>
<param-value>127.0.0.1</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>FilterDemo24</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<!--
<filter>
<filter-name>FilterDemo25</filter-name>
<filter-class>com.tomcat.web.FilterDemo25</filter-class>
<init-param>
<param-name>usernameGroup</param-name>
<param-value>liu:user:admin:uper</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>FilterDemo25</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<!--
<filter>
<filter-name>FilterDemo23</filter-name>
<filter-class>com.tomcat.web.FilterDemo23</filter-class>
</filter>
<filter-mapping>
<filter-name>FilterDemo23</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<!--servlet config-->
<!--
<servlet>
<servlet-name>ServletGetDemo21</servlet-name>
<servlet-class>com.tomcat.web.ServletGetDemo21</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletGetDemo21</servlet-name>
<url-pattern>/ServletGetDemo21</url-pattern>
</servlet-mapping>
-->
<session-config>
<session-timeout>60</session-timeout><!--设置回话有效期为60分钟-->
</session-config>
<servlet>
<servlet-name>RequestServlet1</servlet-name>
<servlet-class>com.tomcat.web.RequestServlet1</servlet-class>
</servlet>
<servlet>
<servlet-name>RequestServlet2</servlet-name>
<servlet-class>com.tomcat.web.RequestServlet2</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RequestServlet1</servlet-name>
<url-pattern>/RequestServlet1</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RequestServlet2</servlet-name>
<url-pattern>/RequestServlet2</url-pattern>
</servlet-mapping>
</web-app>








我该怎么修改才能访问啊,Tomcat自带的就能访问
...全文
178 点赞 收藏 8
写回复
8 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
疯雪 2015-09-08
谁来帮我解答下啊,
回复
冷血有情556 2015-09-06
你这是要直接访问servlet吗?
回复
疯雪 2015-09-06
引用 2 楼 u011194363 的回复:
把项目目录发出来看看~确定路径正确?或则重新部署试试。




这是我的项目目录
回复
疯雪 2015-09-06
引用 3 楼 liu_005 的回复:
你这是要直接访问servlet吗?
是直接访问 servlet
回复
空心兜兜 2015-09-06
直接访问servlet下的某个方法,返回一个页面还差不多
回复
qq_221 2015-09-06
回复
嘻嘻嘻- 2015-09-05
把项目目录发出来看看~确定路径正确?或则重新部署试试。
回复
疯雪 2015-09-05
怎么没人回答啊,,求大神帮助
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-09-05 07:53
社区公告
暂无公告