The problem of welcome-file configuration in Web.xml __web

Source: Internet
Author: User

Recently in the building Maven project, just started to configure the Welcome-file is JSP, there is no problem, and then the integration of Struts2,spring wrote a test action, when I will welcome-file to action, run found not to find the file , and then looked up a lot of information to know.

Welcome-file only to serlvet,html,jsp. And Struts2 is done with filter, so unrecognized, the solution has 3 kinds.

1. Web redirect, <welcome-file>index.jsp</welcome-file> in Welcome-file, meta write in index.jsp <meta http-equiv= " Refresh "content=" 0;url=index.action ">

2. Page jumps in the index.jsp using the Jsp:forword tab to jump to Index.action

3. Write <welcome-file>index.action</welcome-file> directly in the welcome-file of Web.xml; You can then create a index.action empty file in the root directory of your project to work properly,

Ps: Currently only under Tomcat can run (tested), jetty seemingly can not (have netizens said, not tested), suggest or use the first or second

References: http://www.jdiy.org/read.jd?id=y0hi94eg4l

http://yjshengshe.iteye.com/blog/641934


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.