HTTP Status 404 - /8/index.jsp
type Status report
message /8/index.jsp
description The requested resource (/8/index.jsp) is not available.
Apache Tomcat/7.0.23
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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="myPackage" extends="struts-default">
<action name="first">
<result>/first.jsp</result>
</action>
</package>
</struts>
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>主页</title>
</head>
<body>
<a href="first.action">请求Struts2</a>
</body>
</html>
first.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>第一个Struts2程序</title>
</head>
<body>
第一个Struts2程序!
<br>
</body>
</html>
哪位大侠帮帮忙哈 小弟感激不尽 我为这个问题烦死了
<package name="myPackage" extends="struts-default">这里配置写错了,应该这样写
<package name="myPackage" extends="struts-default" namespace="/">在以前的版本中,这个namespace是可以省略掉的。。。
你是怎么运行的?
有没有在eclipse中创建服务器?
你创建的这个web项目是dymic web project吗?
蛋疼的struts2的配置问题。
我晕,刚开始写,就不注重编码规范,你按照命名规范重新写一下,你在取看看是那里的问题,另外,建议项目改名的时间直接重新生成一个工程,不要rename