Code example:
<%@ page language = "java"contmenttype = "text/html; charset = utf-8"pageencoding = "utf-8"%> <%// iq.jspout.clearbuffer ()로 이동합니다. request.getQueryString (); response.setHeader ( "location", "iq.jsp"+(param == null? ":("? "+param));%> <%@ page language = "java"contenttype = "text/html; charset = utf-8"pageencoding = "utf-8"%> <%// iq.jsp out.clearbuffer ()로 이동합니다. response.setStatus (httpservletResponse.sc_moved_permanely); 문자열 param = request.getQueryString (); response.setheader ( "위치", "iq.jsp"+(param == null? ":("? "+param)); %> 위에서 언급했듯이 모든 액세스는 다운로드에 액세스하고 IQ.JSP로 영구적으로 리디렉션됩니다.
매개 변수도 동시에 전달됩니다.
리디렉션이 크로스 도메인이거나 전체 경로를 사용하는 경우 사용할 수 있습니다.
response.setheader ( "위치", "http://www.laozizhu.com/iq.jsp"+(param == null? "":( "?"+param)));
response.setheader ( "위치", "http://www.laozizhu.com/iq.jsp"+(param == null? "":( "?"+param)));
이렇게하면 완전한 이직 도메인 이름을 지정할 수 있습니다.
일반적인 방법은 302 점프를 달성하는 것입니다.
응답 .sendredirect (http://www.baidu.com);
Response.SendRedirect ( "http://www.baidu.com");