頁面直接訪問action
<button onclick='findAndUpdate("${subject.fdId}")'>修改</button>
<script type="text/javascript">
function findAndUpdate(id){
window.location.href="${path}/subject/findSubject.do?args="+id;
}
</script>
<a href=” ${path}/subject/findSubject.do?args="+id”>修改</a>
在頁面獲取path路徑,
頁面的所有路徑就可以這樣寫了
<%
String path = request.getContextPath();
String basePath = request.getScheme() +"://"
+request.getServerName() + ":" + request.getServerPort()
+ path + "/";
request.setAttribute("path", path);
%>