`

<welcome-file>index.do 执行action

阅读更多
很多人肯定用tomcat的时候会遇到类似的问题。。。
配置了
web.xml配置:


Xml代码
<welcome-file-list> <welcome-file>index.do</welcome-file> </welcome-file-list>   



但没有用,还是会404错误....挺烦人的,只能弄一个index.html重定向到index.do 但无疑是网站首页访问效率降低了,等于request了2个请求。。

无意看了一下tomcat注释

When a request URI refers to a directory, the default servlet looks for a "welcome file" within that directory and, if present,  to the corresponding resource URI for display


也就是说,必须web-app目录下有index.do这个文件。。。。。。
2
0
分享到:
评论
1 楼 winter8 2010-01-05  
同是天涯沦落人啊!

相关推荐

    Jboss启动报Failed to parse WEB-INFweb.xml; - nested throwable错误

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; ``` 其他可能的解决方案 除了检查web.xml文件中的配置之外,还有其他可能的解决方案,例如: * 检查Jboss应用服务器的日志文件,以便了解错误的...

    Android View Animations

    &lt;artifactId&gt;library&lt;/artifactId&gt; &lt;version&gt;2.4.0&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.daimajia.androidanimation&lt;/groupId&gt; &lt;artifactId&gt;library&lt;/artifactId&gt; &lt;version&gt;1.1.3&lt;/version&gt; ...

    cas 配置client 1.0 &2.0 及proxy DEMO 说明

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; 4 cas client 2.0配置说明 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="2.5" xmlns=...

    Spring MVC 框架应用实例

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;welcome-file&gt;index.html&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;jsp-config&gt; &lt;taglib&gt; &lt;taglib-uri&gt;http://java.sun.com/jsp/jstl/core&lt;/taglib-uri&gt; ...

    过滤器的做法

    &lt;filter&gt;  &lt;filter-name&gt;Encoding&lt;/filter-name&gt;  &lt;filter-class&gt;com.jkx.demo.cn.Encoding&lt;/filter-class&gt;  &lt;/filter&gt; ... &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt;

    Spring MVC 入门实例

    46 &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; 47 &lt;welcome-file&gt;index.html&lt;/welcome-file&gt; 48 &lt;/welcome-file-list&gt; 49 50 &lt;jsp-config&gt; 51 &lt;taglib&gt; 52 &lt;taglib-uri&gt;http://java.sun.com/jsp/jstl/core&lt;/taglib-...

    一个在线报名系统

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;welcome-file&gt;default.html&lt;/welcome-file&gt; &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt; &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; ...

    briup书城项目

    为了方便理解和说明,这里... &lt;welcome-file&gt;login.jsp&lt;/welcome-file&gt;  1.2:点击后台登录,根据action到index.jsp页面。  &lt;form action="view/system/main/index.jsp" method="post" check()"&gt;&lt;/form&gt;

    spring_MVC源码

    22. &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; 23. &lt;/welcome-file-list&gt; 24.&lt;/web-app&gt; spring-servlet,主要配置controller的信息 [java] view plaincopy 01.&lt;?xml version="1.0" encoding="UTF-8...

    最简化velocity的web工程

    1.基础jar包 ... &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; 3.index.vm代码 $!isSuccess 4.访问地址 http://IP:端口/vlo/hello 访问配置的servlet--&gt;返回vm界面

    tomcat配置文件web.xml与server.xml解析

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; 在上面的配置中,定义了 Welcome 文件的列表,包括 index.html、index.htm 和 index.jsp。 二、server.xml 配置文件 server.xml 配置文件是 ...

    生活轨迹SSH服务端

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;!-- 默认找的文件名 --&gt; &lt;/listener...

    t淘淘商城项目 商城项目 视频和源码教程 详细

    &lt;commons-fileupload.version&gt;1.3.1&lt;/commons-fileupload.version&gt; &lt;jedis.version&gt;2.7.2&lt;/jedis.version&gt; &lt;solrj.version&gt;4.10.3&lt;/solrj.version&gt; &lt;/properties&gt; &lt;dependencyManagement&gt; &lt;dependencies&gt; &lt;...

    struts2配置2.5版

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;!-- 配置核心拦截器 --&gt; &lt;filter&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;!-- Filter的实现类 struts2.5 --&gt; &lt;filter-class&gt; ...

    基于EXT SSI的简单树实现

    &lt;welcome-file&gt;page/index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;!-- web应用启动时初始化applicationContext --&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener...

    聊天室(ActionScript 3.0实现)

    聊天室(ActionScript 3.0实现)&lt;?xml version="1.0" encoding="UTF-8"?&gt; -&lt;web-app xsi:schemaLocation=...-&lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt;

    servlet3.0新特性源代码

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; */ @SuppressWarnings("all") @WebServlet(name="fileUploadServlet",urlPatterns="/fileUploadServlet") @MultipartConfig...

    JSF文件上传

    &lt;welcome-file&gt;index.html&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; 上传文件的页面如下: &lt;%@ include file="tags.jsp"%&gt; &lt;f:view&gt; &lt;h:form id="MyForm" enctype="multipart/form-data" &gt; &lt;h:messages...

    SpringStrutsHibernate的配置

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; 把servlet-name等的servlet改为filter就变成了过滤器了。 说明:要继承HttpServlet类 一、 ①处可以随便取一个名字,但一般是和下面②处的类名一样。...

    struts项目搭建

    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;login-config&gt; &lt;auth-method&gt;BASIC&lt;/auth-method&gt; &lt;/login-config&gt; &lt;/web-app&gt; 然后在src目录下新建一个struts.xml文件,内容如下: &lt;!DOCTYPE...

Global site tag (gtag.js) - Google Analytics