一、第一种方法
在action中:
String url = "xxxx";
request.setAttribute("URL", url);
return mapping.findForward("success");
在作为forword的JSP中:
<%
String url = (String) request.getAttribute("URL");
%>
<script>
xx.location.href = "<%=url%>";
</script>
將url作爲參數保存起來,不要運用配置文件來定義forword應該就可以了。
在action中:
String url = "xxxx";
request.setAttribute("URL", url);
return mapping.findForward("success");
在作为forword的JSP中:
<%
String url = (String) request.getAttribute("URL");
%>
<script>
xx.location.href = "<%=url%>";
</script>
將url作爲參數保存起來,不要運用配置文件來定義forword應該就可以了。