コード例 #1
0
  public void run() {
    Registry.activateStandaloneMode();
    Registry.activateMasterTenant();

    final JaloSession jaloSession = JaloSession.getCurrentSession();
    System.out.println("Session ID: " + jaloSession.getSessionID()); // NOPMD
    System.out.println("User: " + jaloSession.getUser()); // NOPMD
    Utilities.printAppInfo();

    RedeployUtilities.shutdown();
  }
コード例 #2
0
  @Override
  public void beforeView(
      final HttpServletRequest request,
      final HttpServletResponse response,
      final ModelAndView modelAndView) {
    final boolean showDebug = Config.getBoolean(SHOW_STOREFRONT_DEBUG_INFO_PROPERTY_KEY, false);

    // Store the show debug flag in a request attribute
    request.setAttribute(SHOW_STOREFRONT_DEBUG_INFO, Boolean.valueOf(showDebug));

    if (showDebug) {
      final JaloSession currentSession = JaloSession.getCurrentSession();

      final TreeMap<String, Object> attributeMap = new TreeMap<String, Object>();
      // Build up the session attributes as a request attribute
      attributeMap.putAll(currentSession.getAttributes());
      // Add the session id as an attribute
      attributeMap.put("JaloSession ID", currentSession.getSessionID());

      request.setAttribute(JALO_SESSION_ATTRIBUTES, mapToString(attributeMap));
    }
  }