【发布时间】:2014-07-12 17:52:09
【问题描述】:
我使用apt-get 在我的 Ubuntu 12.04 服务器上安装了 Tomcat 7。
据我了解,我只需要上传包含.jsp 文件的项目目录和包含web.xml 文件的WEB-INF 目录。
基本路径:/usr/share/tomcat7-root/default-root/test/
index.jsp:/usr/share/tomcat7-root/default-root/test/index.jsp
web.xml:/usr/share/tomcat7-root/default-root/test/WEB-INF/web.xml
index.jsp 文件内容:
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<% out.println("this is a test"); %>
</body>
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>test</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
当我去
mydomain:8080/test/index.jsp
我收到以下错误:
HTTP 状态 404 - /test/index.jsp
输入状态报告
消息/test/index.jsp
说明请求的资源(/test/index.jsp)不可用。
Apache Tomcat/7.0.26
我是否导航到了正确的目录? Tomcat 登陆页面加载 its fine! 页面没有错误,所以我假设 Tomcat 运行正常。
我的 web.xml 属性或文件结构有问题吗?
编辑 - 错字
【问题讨论】:
标签: java apache jsp tomcat ubuntu