Package com.softwarementors.extjs.djn.servlet.ssm

Examples of com.softwarementors.extjs.djn.servlet.ssm.WebContext


 
  @DirectMethod
  public WebContextInfo test_webContext() {
    assert WebContextManager.isWebContextAttachedToCurrentThread();
   
    WebContext context = WebContextManager.get();
    HttpSession session = context.getSession();
    ServletContext application = context.getServletContext();
   
    // Keep a counter of how many times we have called this method in this session
    Integer callsInSession = (Integer)session.getAttribute("callsInSession");
    if( callsInSession == null ) {
      callsInSession = Integer.valueOf(0);
    }
    callsInSession = Integer.valueOf(callsInSession.intValue() + 1);
    session.setAttribute("callsInSession", callsInSession);

    // Keep a counter of how many times we have called this method in this application
    Integer callsInApplication = (Integer)application.getAttribute("callsInApplication");
    if( callsInApplication == null ) {
      callsInApplication = Integer.valueOf(0);
    }
    callsInApplication = Integer.valueOf(callsInApplication.intValue() + 1);
    application.setAttribute("callsInApplication", callsInApplication);
   
    // Return status information
    WebContextInfo result = new WebContextInfo();
    result.callsInApplication = callsInApplication.intValue();
    result.callsInSession = callsInSession.intValue();
    result.sessionId = context.getSession().getId();
    return result;
  }
View Full Code Here

TOP

Related Classes of com.softwarementors.extjs.djn.servlet.ssm.WebContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.