示例#1
0
 protected AMModel getModelInternal() {
   RequestContext rc = RequestManager.getRequestContext();
   HttpServletRequest req = rc.getRequest();
   try {
     return new RestSTSModelImpl(req, getPageSessionAttributes());
   } catch (AMConsoleException e) {
     setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
     throw new IllegalStateException(
         "Exception getting model in RestSTSAddViewBean: " + e.getMessage(), e);
   }
 }
 protected void redirectToHome() {
   if (XuiRedirectHelper.isXuiAdminConsoleEnabled()) {
     RequestContext rc = RequestManager.getRequestContext();
     try {
       String realm = URLEncoder.encode(rc.getRequest().getParameter("realm"), "UTF-8");
       rc.getResponse().sendRedirect("../XUI#realms/" + realm + "/dashboard");
     } catch (UnsupportedEncodingException e) {
       throw new IllegalStateException("UTF-8 not supported", e);
     } catch (IOException e) {
       debug.message("Unexpected IOException during redirect", e);
     }
   } else {
     HomeViewBean vb = (HomeViewBean) getViewBean(HomeViewBean.class);
     backTrail();
     passPgSessionMap(vb);
     vb.forwardTo(getRequestContext());
   }
 }