Examples of ServletExternalContext


Examples of org.apache.myfaces.trinidadinternal.context.external.ServletExternalContext

    // Set a flag so that we can detect if the filter has been
    // properly installed.
    request.setAttribute(_FILTER_EXECUTED_KEY, Boolean.TRUE);

    ExternalContext externalContext = new ServletExternalContext(_servletContext, request, response);   
    GlobalConfiguratorImpl config = GlobalConfiguratorImpl.getInstance();
    config.beginRequest(externalContext);
   
    String noJavaScript = request.getParameter(TrinidadRenderingConstants.NON_JS_BROWSER);
       
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.context.external.ServletExternalContext

    ServletResponse response,
    FilterChain     chain) throws IOException, ServletException
  {
    // -= Scott O'Bryan =-
    // Added for backward compatibility
    ExternalContext ec = new ServletExternalContext(_servletContext, request, response);
    boolean isHttpReq = ExternalContextUtils.isHttpServletRequest(ec);
   
    if(isHttpReq)
    {
      response = _getResponse(ec);
      ec.setResponse(response);
    }
    
    // Set up a PseudoFacesContext with the actual request and response
    // so that RequestContext can be more functional in the interval
    // between now and when the FacesServlet starts.
    PseudoFacesContext pfc = new PseudoFacesContext(ec);
    _PSEUDO_FACES_CONTEXT.set(pfc);
    try
    {
      if(isHttpReq)
      {
        // If there are existing "launchParameters", then that means
        // we've returned from a "launch", and we need to re-execute the
        // faces lifecycle.  ViewHandlerImpl will be responsible for ensuring
        // that we re-execute the lifecycle on the correct page.
        // -= Simon Lessard =-
        // FIXME: Using <String, String[]> for now to accomodate ReplaceParametersRequestWrapper.
        //        However, the Servlet specification suggest <String, Object> so this
        //        could lead to some nasty problems one day. Especially if JEE spec includes
        //        generics for its Servlet API soon.
        //
        // -= Scott O'Bryan =-
        // TODO: The following should be made available to the Portal.  This is not trivial
        //       because this just re-invokes the filter chain with a new set of parameters.
        //       In the portal environment, this must rerun the portlet without the use of
        //       filters until Portlet 2.0.
        request = _getRequest(ec);
        ec.setRequest(request);
      }
     
      chain.doFilter(request, response);

      if(isHttpReq)
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.context.external.ServletExternalContext

    // Set a flag so that we can detect if the filter has been
    // properly installed.
    request.setAttribute(_FILTER_EXECUTED_KEY, Boolean.TRUE);

    ExternalContext externalContext = new ServletExternalContext(_servletContext, request, response);   
    GlobalConfiguratorImpl config = GlobalConfiguratorImpl.getInstance();
    config.beginRequest(externalContext);
   
    //To maintain backward compatibilty, wrap the request at the filter level
    Map<String, String[]> addedParams = FileUploadConfiguratorImpl.getAddedParameters(externalContext);
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.context.external.ServletExternalContext

    ServletResponse response,
    FilterChain     chain) throws IOException, ServletException
  {
    // -= Scott O'Bryan =-
    // Added for backward compatibility
    ExternalContext ec = new ServletExternalContext(_servletContext, request, response);
    HttpServletResponse dispatch = new DispatchServletResponse(ec);
    DispatchResponseConfiguratorImpl.apply(ec);

    _invokeDoFilter(request, dispatch, chain);
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.context.external.ServletExternalContext

  {
    // Set up a PseudoFacesContext with the actual request and response
    // so that RequestContext can be more functional in the interval
    // between now and when the FacesServlet starts.
    PseudoFacesContext pfc = new PseudoFacesContext(
      new ServletExternalContext(_servletContext, request, response));
    _PSEUDO_FACES_CONTEXT.set(pfc);
    try
    {
      chain.doFilter(request, response);
    }
View Full Code Here

Examples of org.springframework.webflow.context.servlet.ServletExternalContext

    }

    @Override
    @SuppressWarnings("unchecked")
    public Object getReferenceInFlowScope(String flowExecutionKey, String referenceName, HttpServletRequest request) {
        ExternalContextHolder.setExternalContext(new ServletExternalContext(servletContext, request, null));
        FlowExecutionRepository executionRepository =  ((FlowExecutorImpl) flowExecutor).getExecutionRepository();
        FlowExecution flowExecution = executionRepository.getFlowExecution(executionRepository.parseFlowExecutionKey(flowExecutionKey));
        FlowSession flowSession = flowExecution.getActiveSession();
        return flowSession.getScope().get(referenceName);
    }
View Full Code Here

Examples of org.springframework.webflow.context.servlet.ServletExternalContext

    controller.setApplicationContext(new StaticWebApplicationContext());
    controller.afterPropertiesSet();

    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    context = new ServletExternalContext(servletContext, request, response, controller.getFlowUrlHandler());
  }
View Full Code Here

Examples of org.springframework.webflow.context.servlet.ServletExternalContext

    request.setPathInfo("/fooFlow");
    request.setMethod("POST");
    request.addParameter("prop", "A");
    MockHttpServletResponse response = new MockHttpServletResponse();
    MockRequestContext context = new MockRequestContext();
    context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
    context.setAttribute("method", "bindAndValidate");

    // use a FormAction to do the binding
    FormAction formAction = new FormAction();
    formAction.setFormObjectClass(TestBean.class);
View Full Code Here

Examples of org.springframework.webflow.context.servlet.ServletExternalContext

      }
    };

    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    context = new ServletExternalContext(servletContext, request, response, flowHandlerAdapter.getFlowUrlHandler());
  }
View Full Code Here

Examples of org.springframework.webflow.context.servlet.ServletExternalContext

        this.action.afterPropertiesSet();
    }
   
    public void testNoCredentialsResultsInError() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), new MockHttpServletRequest(), new MockHttpServletResponse()));
        assertEquals("error", this.action.execute(context).getId());
    }
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.