确认目录下有我的html文件,但仍然是404。

问题一:

指定目录下没有访问的文件,这是最常见的,也是最容易解决的。只需要将访问的文件(如:a.html)放到指定目录下即可。

问题二:

将访问的文件(如:b.html)放到了webapps的根目录下,然后访问http://localhost:8080/b.html,这种方式也会造成404错误,              
解决方法:在webapps下新建一个目录(如:test),然后将b.html 放到test目录里面。访问网址  http://localhost:8080/test/b.html

问题三:

访问的目录下的web.xml 文件内容有误。解放方法是可以直接删除web.xml或写入下面的内容

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>ss</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

tomcat404的更多相关文章

  1. tomcat404报错解决

    本地启动tomcat,不报错.也可正常打开http://localhost:8080 但是eclipse中启动tomcat不报错.但是打开http://localhost:8080时报404 思考,原 ...

  2. idea部署tomcat-404错误

    今天在部署数据质量web工程在tomcat后,访问时报404错误,在网上搜了很多相关配置,也都是一步一步来的 Application Context 也配置好了,Artifact也添加了,就是访问不了 ...

  3. Springmvc ModelAndView踩过的坑之HttpServletResponse response

    先抛出问题.以下两个方法声明有毛区别: @RequestMapping(value = "/rg") public void rg(@PathVariable Long pageI ...

  4. Eclipse启动和手动启动tomcat访问localhost:8080显示404问题总结

    前言:建议对tomcat的文件结构和相关属性有较多了解.本文以eclipse的DynamicWebProject为讲解对象. 目录: eclipse添加tomcat关联注意点 tomcat404问题归 ...

  5. 从零开始部署发布Java项目到服务器的Docker中

    本以为很简单,由于没用过docker和java,本文将会阐述一路遇到的拦路虎. 首先,写好Java项目,本地跑通. 可能会遇到的问题: 1.jar包正常运行,war包404: 如何打包很多教程都有介绍 ...

随机推荐

  1. vue之导入Bootstrap和Jquery

    Vue引入bootstrap主要有两种方法 方法一:在main.js中引入,此方法导入的bootstrap中对于html,body的一些预设置的css样式可能无效. 一.引入jQuery 在当前项目的 ...

  2. Vuex.js状态管理共享数据 - day8

    VScode文件目录: amount.vue代码如下: <template> <div> <!-- <h3>{{ $store.state.count }}& ...

  3. IOS照相

    #import <UIKit/UIKit.h> @interface AddPictureViewController : UIViewController<UIImagePicke ...

  4. Javafinal变量

    class Test02 {     public static void main(String args[]){         final int x;         x = 100; //  ...

  5. iPhone Tutorials

    http://www.raywenderlich.com/tutorials This site contains a ton of fun written tutorials – so many t ...

  6. feature map计算大小公式

    http://blog.csdn.net/cheese_pop/article/details/51955915 将整个分成两部分,左边部分,右边部分.右边部分每次其实都是移动stride这么大,左边 ...

  7. 【单片机实验】6LED静态串行显示

    实验三 6LED静态串行显示一.实验目的1.掌握数字.字符转换成由数码管显示的八段码的软件译码方法及译码过程:2.静态显示的原理和相关程序的编写. 二.实验电路静态显示 电路如图3-2所示.显示器由6 ...

  8. Velocity模板语法说明

    Velocity基本语法 "#"用来标识Velocity的关键字,包括#set.#if .#else.#end.#foreach.#end.#include.#parse.#mac ...

  9. CPP-网络/通信:WebService

    工具:vc2003 //引入相关头文件,连接动态库,定义全局变量. //***************************************************** #include & ...

  10. C-基础:详解sizeof和strlen,以及strstr

    sizeof和strlen (string.h) 先看几个例子(sizeof和strlen之间的区别):  (1) 对于一个指针, char* ss ="0123456789"; ...