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

  • 相关阅读:
    在家工作,10招助你效率、生活两不误
    SQL Server智能感知如何更新
    博客园文章《我记录,故我在》读后感
    Python 协程
    Python 用多线程上传和下载文件
    Python 变量交换
    Python 将文件重新命名
    Python ftplib模块
    Python ftplib模块
    Python 函数作为返回值
  • 原文地址:https://www.cnblogs.com/xiaxj/p/6019055.html
Copyright © 2011-2022 走看看