JavaScript页面跳转

<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>

<%
  /*准备主页请求地址*/
  String homePage = request.getContextPath()+"/index.action";
  if (request.getAttribute("homePage") != null){
    homePage = (String)request.getAttribute("homePage");
  }
  System.out.println("主页请求:"+homePage);
%>

<%--本页面只用于请求主页--%>
<script type="text/javascript">
  location.href = "<%=homePage%>";
</script>

 

posted @ 2015-06-13 18:19  csnmd  阅读(272)  评论(0)    收藏  举报