SmileFace
与java一起走过的日子
posts - 41,  comments - 8,  trackbacks - 0
今天才知道,有2种方法:

1、适用于所有的servlet:只需修改conf目录下的server.xml即可自动匿名访问所有的servlet。

To let Tomcat run anonymous servlet classes that have not been defined in a web.xml file, you can enable the Tomcat "invoker" servlet by removing the comments around the servlet-mapping element in the web.xml file in the Tomcat conf directory:
  <!-- The mapping for the invoker servlet -->

<!--

  <servlet-mapping>

    <servlet-name>invoker</servlet-name>

    <url-pattern>/servlet/*</url-pattern>

  </servlet-mapping>

-->

When you edit web.xml in the Tomcat conf directory, the servlet is ready to go。

例如,after saving Ch09_06.java and building the project, start Tomcat with the Tomcat plug-in's buttons and navigate to http://localhost:8080/Ch09_06/servlet/org.eclipsebook.ch09.Ch09_06.

2、就是编辑每个项目中的web.xml文件:

lternatively, if you don't want to edit web.xml in the Tomcat conf directory to enable anonymous servlets, you can create a local web.xml for each project you create with the Tomcat plug-in.

posted on 2006-10-11 03:01 SmileFace 阅读(279) 评论(0)  编辑  收藏 所属分类: Java-Studying

只有注册用户登录后才能发表评论。


网站导航:
 

<2006年10月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(2)

随笔分类

随笔档案

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜