예제 #1
0
파일: HttpsMapper.java 프로젝트: dmt/wicket
    @Override
    public void respond(IRequestCycle requestCycle) {
      String location = url.toString();

      if (location.startsWith("/")) {
        // context-absolute url
        location = requestCycle.getUrlRenderer().renderContextRelativeUrl(location);
      }

      if (config.isPreferStateful()) {
        // we need to persist the session before a redirect to https so the session lasts
        // across both http and https calls.
        Session.get().bind();
      }

      WebResponse response = (WebResponse) requestCycle.getResponse();
      response.sendRedirect(location);
    }