錯誤:訪問URL http://localhost:8080/Structs2/login.action
HTTP Status 404 - /Structs2/login.action
type Status report
message /Structs2/login.action
description The requested resource is not available.
代碼:
G:\Workspaces\MyEclipse\Structs2\WebRoot\login.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
G:\Workspaces\MyEclipse\Structs2\src\struts.xml
/result.jsp
G:\Workspaces\MyEclipse\Structs2\src\com\action\login\LoginAction.java
package com.action.login;
public class LoginAction {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
/**
* 賦值之後會自動執行
* @return
* @throws Exception
*/
public String execute() throws Exception {
System.out.println("execute()");
return "success";
}
}
G:\Workspaces\MyEclipse\Structs2\WebRoot\WEB-INF\lib\web.xml
<?xml version="1.0" encoding="UTF-8"?>
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
struts2
org.apache.struts2.dispatcher.FilterDispatcher
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
跟著網上各種方法都解決不了,但是是跟著浪曦的視頻做的,視頻裡的可以運行,自己的不行,求大神解答
把你的錯誤信息全部出來貼