public void handleError(PresentableState state, Throwable t) throws IOException, ServletException { state.getResponse().setHeader("X-Frame-Options", "DENY"); JSPUtil.handleException(t, state.getRequest(), state.getResponse(), ERROR_PAGE); }
public void handleError(PresentableState state, Throwable t) throws IOException, ServletException { AuthorizedState aState = (AuthorizedState) state; state.getResponse().setHeader("X-Frame-Options", "DENY"); state.getRequest().setAttribute("client", aState.getTransaction().getClient()); JSPUtil.handleException(t, state.getRequest(), state.getResponse(), ERROR_PAGE); }
public void prepare(PresentableState state) throws Throwable { preprocess(new TransactionState(state.getRequest(), state.getResponse(), null, null)); switch (state.getState()) { case INITIAL_STATE: HttpServletRequest request = state.getRequest(); info("Processing new client registration request."); request.setAttribute(CLIENT_NAME, CLIENT_NAME); request.setAttribute(CLIENT_PUBLIC_KEY, CLIENT_PUBLIC_KEY); request.setAttribute(CLIENT_HOME_URL, CLIENT_HOME_URL); request.setAttribute(CLIENT_ERROR_URL, CLIENT_ERROR_URL); request.setAttribute(CLIENT_EMAIL, CLIENT_EMAIL); request.setAttribute(CLIENT_PROXY_LIMITED, CLIENT_PROXY_LIMITED); request.setAttribute(CLIENT_ACTION_KEY, CLIENT_ACTION_KEY); request.setAttribute(CLIENT_ACTION_REQUEST_VALUE, CLIENT_ACTION_REQUEST_VALUE); request.setAttribute("actionToTake", request.getContextPath() + "/register"); break; case REQUEST_STATE: // nothing to do. return; case ERROR_STATE: default: warn("Error: unknown action request."); } }
public void present(PresentableState state) throws Throwable { postprocess(new TransactionState(state.getRequest(), state.getResponse(), null, null)); switch (state.getState()) { case INITIAL_STATE: JSPUtil.fwd(state.getRequest(), state.getResponse(), INIT_PAGE); break; case REQUEST_STATE: if (state instanceof ClientState) { ClientState cState = (ClientState) state; state.getRequest().setAttribute("client", cState.getClient()); JSPUtil.fwd(state.getRequest(), state.getResponse(), OK_PAGE); } else { throw new IllegalStateException("Error: An instance of ClientState was expected, but got an instance of \"" + state.getClass().getName() + "\""); } break; case ERROR_STATE: default: } }
JSPUtil.fwd(state.getRequest(), state.getResponse(), initPage); info("3.a. User information obtained for grant = " + aState.getTransaction().getAuthorizationGrant()); break; case AUTHORIZATION_ACTION_OK: JSPUtil.fwd(state.getRequest(), state.getResponse(), OK_PAGE); break; default: