Examples of WebContext


Examples of com.cfinkel.reports.web.WebContext

    }

    public String getQueryString(Map<Input, Object> parameters) throws ParseException {
        // get the user from session:
        String userName = "unknown user";
        WebContext user = WebContext.get();
        if (user != null) {
            userName = Util.getUserName(user.getRequest());
        }

        //         * reconstruct original rqeuest param map (a bit of a kludge)
        //   * todo: make less kludgey
        Map<String, Object> stringParameters = new HashMap<String, Object>();
View Full Code Here

Examples of com.dotcms.repackage.org.directwebremoting.WebContext

  public static Map<String,Object> importTags(byte[] uploadFile) {

    Map<String,Object> callbackData = new HashMap<String,Object>();
    try {
      UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
      WebContext ctx = WebContextFactory.get();
      HttpServletRequest request = ctx.getHttpServletRequest();
      User user = uWebAPI.getLoggedInUser(request);

      String content = new String(uploadFile);
      StringReader sr = new StringReader(content);
      BufferedReader br = new BufferedReader(sr);
View Full Code Here

Examples of com.firefly.mvc.web.WebContext

    start(config);
  }
 
  public static void start(Config config) {
    long start = System.currentTimeMillis();
    WebContext context = new ServerAnnotationWebContext(config);
    try {
      Config c = context.getBean(Config.class);
      init(context, c == null ? config : c);
    } catch (Throwable e) {
      log.error("firefly init error", e);
    }
    long end = System.currentTimeMillis();
View Full Code Here

Examples of com.google.greaze.definition.rest.WebContext

        stub, MyResource.CALL_PATH, MyResource.class, new GsonBuilder(), false);
  }

  public void testPost() throws Exception {
    MyResource sent = new MyResource(10);
    MyResource received = client.post(sent, new WebContext());
    assertEquals(sent.value, received.value);
  }
View Full Code Here

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

Examples of jweblite.web.page.WebContext

      respWrapper = (JWebLiteResponseWrapper) resp;
    } else {
      respWrapper = new JWebLiteResponseWrapper(req, resp, encoding,
          filterConfig.isGZipEnabled());
    }
    WebContext context = new WebContext(req, respWrapper);
    // prepare default variables
    req.setAttribute(attrPrefix.concat("CP"), req.getContextPath());
    // session manager
    req.getSession(true).setAttribute(attrPrefix.concat("SessionManager"),
        JWebLiteSessionManager.get());
View Full Code Here

Examples of org.apache.commons.chain.web.WebContext

    public boolean execute(Context context) throws Exception {

        count++;
        log.info("Executing: " + attribute + "=" + count);

        WebContext webContext = (WebContext)context;
        webContext.getSessionScope().put(attribute, new Integer(count));

        return false;

    }
View Full Code Here

Examples of org.apache.commons.workflow.web.WebContext

    protected WebContext getContext(ActionMapping mapping,
            HttpServletRequest request, HttpServletResponse response) {

        String contextId = mapping.getParameter();
        HttpSession session = request.getSession();
        WebContext context = (WebContext)
            session.getAttribute(contextId);
        if (context == null) {
            if (doDebugLog())
                servlet.log("{" + session.getId() + "} Creating new Context");
            context = new WebContext();
            // context.setActivity(getActivity(contextId));
            context.setActivity(activity);
            context.setHttpSession(session);
            context.setServletContext(servlet.getServletContext());
            if (doDebugListener())
                context.addContextListener(this);
            session.setAttribute(contextId, context);
            context.call(context.getActivity());
        }
        return context;

    }
View Full Code Here

Examples of org.apache.openejb.core.WebContext

            } else {
                path += "/" + standardContext.getPath();
            }
        }

        WebContext webContext = cs.getWebContext(path);
        if (webContext == null) { // tomee-embedded deployment
            webContext = cs.getWebContext(standardContext.getPath().replaceFirst("/", ""));
            if (webContext == null) {
                webContext = cs.getWebContext(standardContext.getPath());
            }
        }

        if (webContext != null && webContext.getBindings() != null) {
            for (Map.Entry<String, Object> entry : webContext.getBindings().entrySet()) {
                try {
                    final String key = entry.getKey();
                    Object value = normalize(entry.getValue());
                    Contexts.createSubcontexts(root, key);
                    root.rebind(key, value);
                } catch (NamingException e) {
                    e.printStackTrace();
                }
            }
        }

        // try to force some binding which probably failed earlier (see in TomcatWebappBuilder)
        try {
            Context comp = (Context) ContextBindings.getClassLoader().lookup("comp");
            TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
            comp.rebind("TransactionManager", transactionManager);

            // bind TransactionSynchronizationRegistry
            TransactionSynchronizationRegistry synchronizationRegistry = SystemInstance.get().getComponent(TransactionSynchronizationRegistry.class);
            comp.rebind("TransactionSynchronizationRegistry", synchronizationRegistry);

            comp.rebind("ORB", new SystemComponentReference(ORB.class));
            comp.rebind("HandleDelegate", new SystemComponentReference(HandleDelegate.class));

            if (webContext != null) {
                comp.rebind("BeanManager", webContext.getAppContext().getBeanManager());
            }
        } catch (Exception ignored) {
            ignored.printStackTrace();
            // no-op
        }
View Full Code Here

Examples of org.apache.openejb.core.WebContext

                // merge OpenEJB jndi into Tomcat jndi
                final TomcatJndiBuilder jndiBuilder = new TomcatJndiBuilder(standardContext, webAppInfo, injections);
                jndiBuilder.mergeJndi();

                // add WebDeploymentInfo to ContainerSystem
                final WebContext webContext = new WebContext(appContext);
                webContext.setClassLoader(classLoader);
                webContext.setId(webAppInfo.moduleId);
                webContext.setBindings(bindings);
                webContext.getInjections().addAll(injections);
                appContext.getWebContexts().add(webContext);
                cs.addWebContext(webContext);

                standardContext.setInstanceManager(new JavaeeInstanceManager(webContext, standardContext));
                standardContext.getServletContext().setAttribute(InstanceManager.class.getName(), standardContext.getInstanceManager());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.