这是我的JSP页面
<html:html lang="true">
<body>
<form action="/search" method="post" >
<input type="text" name="data_id" >
<input type="submit" >
</form>
</body>
</html:html>
这是struts配置文件
<action-mappings >
<action
input="index.jsp"
path="/search"
name="/searchForm"
type="com.yourcompany.struts.action.SearchAction" >
<forward name="success" path="/quote.jsp"/>
<forward name="faliue" path="/error.jsp"/>
</action>
为啥在JSP中提交总是找不到页面 说是找不到/search 哪里配置不对啊 救救我啊
<html:html lang="true">
<body>
<form action="/search" method="post" >
<input type="text" name="data_id" >
<input type="submit" >
</form>
</body>
</html:html>
这是struts配置文件
<action-mappings >
<action
input="index.jsp"
path="/search"
name="/searchForm"
type="com.yourcompany.struts.action.SearchAction" >
<forward name="success" path="/quote.jsp"/>
<forward name="faliue" path="/error.jsp"/>
</action>
为啥在JSP中提交总是找不到页面 说是找不到/search 哪里配置不对啊 救救我啊
form action="search.do"
里面/search改成 search.do
改成:
加:
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
再
<form action="<%=basePath%>/search.do" method="post" >