<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% String servername=request.getServerName(); String serverPath=request.getServletPath(); String addres="http://www.baidu.com"; response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); response.setHeader("Location",addres); %>
访问这个页面直接跳转到baidu,作用当当前页面出现异常(比如获取移动相关鉴权码没得到时)可以直接重新跳转回当前页面或其他页面进行相关处理.