<?xml?version="1.0"?encoding="UTF-8"?>
???<!DOCTYPE?struts?PUBLIC?"-//Apache?Software?Foundation//DTD?Struts?Configuration?2.1//EN"?"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
???<package?name="defult"?namespace="/"??extends="struts-default">
???
???<default-action-ref?name="index"></default-action-ref>
???<action?name="index">
???????<result>/error.jsp</result>
???</action>
???
???<action?name="*_*"?method="{2}"?class="com.zsq.action.{1}Action">
????????<result>/result.jsp</result>
????????<result?name="add">/{2}.jsp</result>
????????<result?name="update">/{2}.jsp</result>
???</action>
???</package>
???</struts>
<%@?page?language="java"?import="java.util.*"?pageEncoding="ISO-8859-1"%>
<%
String?path?=?request.getContextPath();
String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN">
<html>
??<head>
????<base?href="<%=basePath%>">
????
????<title>My?JSP?'error.jsp'?starting?page</title>
????
<meta?http-equiv="pragma"?content="no-cache">
<meta?http-equiv="cache-control"?content="no-cache">
<meta?http-equiv="expires"?content="0">????
<meta?http-equiv="keywords"?content="keyword1,keyword2,keyword3">
<meta?http-equiv="description"?content="This?is?my?page">
<!--
<link?rel="stylesheet"?type="text/css"?href="styles.css">
-->
??</head>
??
??<body>
????Sorry,not?found!?<br>
??</body>
</html>
2016-10-12
同問,我把action放在兩個不同的package中問題就解決了。但是為什么放在同一個package中的時候默認的就沒有用了
2016-06-01
什么意思,{2}后加上后綴變成{2}.get嗎?那樣就無法運行了
2016-05-31
12行的?method="{2}" ?要改一下 ? method一般后面是"post"或者"get"
2016-05-31
12行的?method="{2}" ?要改一下 ? method一般后面是"post"或者"get"