【发布时间】:2016-05-30 18:29:31
【问题描述】:
我在这个example有问题
我为 Java EE 和 Apache Tomcat 8 使用 eclipse。 我的项目结构:
web.xml 代码:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Hello World Struts 2</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
其他文件代码与struts网站相同。 当我运行 index.jsp 文件时,出现以下错误:
**HTTP 状态 404 - /helloworld/index.jsp
输入状态报告
消息 /helloworld/index.jsp 描述 请求的资源不可用。**
有人能找出我不能运行它的原因吗?
【问题讨论】:
-
应用部署的上下文是什么?
-
如果你的意思是这个项目的“web项目设置”选项,上下文根是helloworld
-
这是项目的名称,而不是应用上下文。
-
你的意思是项目方面使用的java版本和项目方面的运行时?