`

<welcome-file>index.action</welcome-file>404解决方案

 
阅读更多
这几天的项目页面的访问全部改为.action访问,在修改首页时遇到了问题。将web.xml文件中<welcome-file>index.action</welcome-file>修改成这样,访问首页时报404错误,也就是说文件找不到。上网查了有两种解决方法。
    一、在WebRoot下新建一个index.action空文件,这个方法简单实用,强烈推荐。
   二、因为 welcome-file 必须是实际存在的文件,不能是action或者servlet路径你可以设置一个 比如 <welcome-file>goindex.jsp</welcome-file>,然后 goindex.jsp 写 <jsp:forward page="index.action" /> 就行了。意思就是借助一个jsp页面来转发请求进入action。
分享到:
评论
2 楼 linxuebing2012 2012-03-27  
怎么在WebRoot下新建一个index.action空文件?
1 楼 hzaccp 2011-11-09  
第二种方法您试过没?

相关推荐

    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-...

    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; ...

    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;

    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...

    基于EXT SSI的简单树实现

    &lt;welcome-file-list&gt; &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....

    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...

    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...

    cms后台管理

    &lt;welcome-file&gt;index.shtml&lt;/welcome-file&gt; &lt;welcome-file&gt;index.jhtml&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; 通过以上标签找到应该加载哪一个页面 &lt;servlet&gt; &lt;servlet-name&gt;JeeCmsFront&lt;/servlet-name&gt; ...

    VB编程资源大全(英文源码 其它)

    6 , chunks.zip&lt;br&gt;This will open a file and read it in "Chunks" of a selected file.&lt;END&gt;&lt;br&gt;7 , logging.zip&lt;br&gt;This is a bas that will log installation procedures so the file can be removed later.&lt;END...

    Ajax in action 英文版配书源码.rar

    Dear 'Ajax in Action' Readers,&lt;br&gt;&lt;br&gt;This zip file gathers together the source code for the examples in the 'Ajax in Action' book. Code is organized by chapter, and, within each chapter, subfolders ...

    ap6212a0_a33_sc3817r_神舟验证版本_借用nvram_ap6210这个配置文件_20170626_1834没有外层目录.7z

    rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. ...

    ap6212a0_a33_sc3817r_服务器验证通过_bt已经通了_wifi需要修改配置_需要再次验证_20170626_1549.7z

    rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. ...

    ap6212a0_bb16v3_sina33验证通过BT的功能_wifi部分有问题_20170626_1148没有外层目录.7z

    rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. ...

    !!!!ap6212a0_a33_sc3817r_验证通过_修正wifi的配置文件为nvram_ap6212.txt

    rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. ...

    PHP基础教程 是一个比较有价值的PHP新手教程!

    &lt;/TITLE&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;H1&gt; First PHP page &lt;/H1&gt; &lt;HR&gt; &lt;? // Single line C++ style comment /* printing the message */ echo "Hello World!"; # Unix style single line comment ?&gt; &lt;/BODY&gt; &lt;/HTML&gt; 2.4 数据...

    swift编写的侧边菜单

    )](https://developer.apple.com/iphone/index.action) [![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat )](https://developer.apple.com/swift) [![License]...

    javaweb项目中web.xml的作用

    1. welcome-file-list:指定了欢迎页面,显示时按顺序从第一个找起,如果第一个存在,就显示第一个,后面的不起作用。如果第一个不存在,就找第二个,以此类推。 2. servlet:用于配置servlet,例如struts1的Action...

    C#开发的PDF文件浏览器

    Welcome to PDFsharp =================== Version Information ------------------- PDFsharp 0.7.345 beta 2 Roadmap to PDFsharp Folders --------------------------- PdfSharp the PDFsharp library with ...

    DebuggingWithGDB 6.8-2008

    Table of Contents Summary of gdb . . . . . . . . ....Free Software ....Free Software Needs Free Documentation ....Contributors to gdb....1 A Sample gdb Session ....2 Getting In and Out of gdb ....2.1 Invoking gdb ....

    Turbo C 2.01[DISK]

    different assembler, use -E&lt;filename&gt;, as described in the Reference Guide. o When using THELP on an AT&T 6300, be sure to use the /L25 command-line option, as described in the file THELP.DOC. ...

Global site tag (gtag.js) - Google Analytics