zoukankan      html  css  js  c++  java
  • Tomcat问题,不能正确访问http://localhost:8080/

    最近在学Struts2框架部分的内容,但是eclipse中配置tomcat遇到了很大的问题,当辛辛苦苦的配置完了之后,竟让连小猫的首页都不能访问,http://localhost:8080/输入了之后提示HTTP Status 404

    type Status report
    
    message /sOffice2/
    
    description The requested resource  is not available.
    

      于是乎,心酸的查找bug开始了,

    (1)首先xxx.jsp文件必须放在WebContent目录下面,而不能放在WEB_INF目录之下

    (2)第二个问题是在Stack overflow上面找到了答案:

    1:Click on Window > Show view > Server or right click on the server in "Servers" view, select "Properties".
    2:In the "General" panel, click on the "Switch Location" button.
    3:The "Location: [workspace metadata]" should replace by something else.
    4:Open the Overview screen for the server by double clicking it.In the Server locations tab , select "Use Tomcat location".(此时有可能界面为灰色)
    5:Save the configurations and restart the Server.

    方法里面说将tomcat换成自己的安装的tomcat,但是界面是灰色的,怎么办呢?原来是因为我们将项目部署到了tomcat上面,因此需要移除项目,在项目上面右击——Remove

    此时Server locations界面即可用,"Deploy Path"后面的值默认是"wtpwebapps",把它改成"webapps",(这里面改成webapps也就是找到自己安装tomcat的目录,只不过换了名字之后软件可以自己定位到目录)

    到此,问题就搞定了,入托上面两个方法我全部都没有用。

    (3)即使eclipse中的tomcat服务器打开了,也没有,必须把外部的tomcat服务器打开。

    c

  • 相关阅读:
    【区间DP】低价回文
    【二分图】文理分班
    【线型DP】洛谷P2066 机器分配
    电路原理 —— 电路基本概念和电路定律(1)
    数据结构(1) —— 绪论
    静电场 —— 电通量 高斯定理
    电路原理 —— 三相电路(1)
    静电场 —— 电场 电场强度
    静电场 —— 电荷 库伦定律
    Python——jieba库初使用
  • 原文地址:https://www.cnblogs.com/xiaxj/p/6019055.html
Copyright © 2011-2022 走看看