HTTP Status 400 - Invalid path /showsport was requested
type Status report
message Invalid path /showsport was requested
description The request sent by the client was syntactically incorrect (Invalid path /showsport was requested).
Apache Tomcat/5.5.17
上面是我遇到的问题,经过仔细的检查发现是一个很小的问题却导致的。
下面是引起这个问题的源代码:
<%
for(int i=0;i<sportlist.size();i++)
{
AbstractSportnote sportnote=(Sportnote)sportlist.get(i);
%>
<tr>
<td valign="top" bgColor="#ffffff"><%=sportnote.getNoteSendUser()%></td>
<td valign="top" bgColor="#ffffff">
<a href="showsport.do?sportnoteNum=<%=sportnote.getNoteNumber() %>">
<%=sportnote.getNotePost()%>
</a>
</td>
<td valign="top" bgColor="#ffffff"><%=sportnote.getNoteTime() %></td>
<td valign="top" bgColor="#ffffff">编辑<br></td>
</tr>
<%
} %>
其中红色的那行就是问题出现的地方:
我在.jsp页面请求的时候是用:showsport.do,而我自己在struts-config.xml中却是(如下):
<action
input="/sports.jsp"
path="/showsports"
type="struts.action.ShowsportsAction" />
所以出错了,发现了想和大家一起分享。