Package org.springframework.js.ajax

Examples of org.springframework.js.ajax.AjaxHandler


    public void render(
            final Map<String, ?> model, final HttpServletRequest request, final HttpServletResponse response)
            throws Exception {
       

        final AjaxHandler templateAjaxHandler = getAjaxHandler();
       
        if (templateAjaxHandler == null) {
            throw new ConfigurationException("[THYMELEAF] AJAX Handler set into " +
                    AjaxThymeleafView.class.getSimpleName() + " instance for template " +
                    getTemplateName() + " is null.");
        }
       
        if (templateAjaxHandler.isAjaxRequest(request, response)) {
           
            final String[] fragmentsToRender = getRenderFragments(model, request, response);
            if (fragmentsToRender.length == 0) {
                vlogger.warn("[THYMELEAF] An Ajax request was detected, but no fragments were specified to be re-rendered.  "
                        + "Falling back to full page render.  This can cause unpredictable results when processing "
View Full Code Here


    public void render(
            final Map<String, ?> model, final HttpServletRequest request, final HttpServletResponse response)
            throws Exception {
       

        final AjaxHandler templateAjaxHandler = getAjaxHandler();
       
        if (templateAjaxHandler == null) {
            throw new ConfigurationException("[THYMELEAF] AJAX Handler set into " +
                    AjaxThymeleafView.class.getSimpleName() + " instance for template " +
                    getTemplateName() + " is null.");
        }
       
        if (templateAjaxHandler.isAjaxRequest(request, response)) {
           
            final String[] fragmentsToRender = getRenderFragments(model, request, response);
            if (fragmentsToRender.length == 0) {
                vlogger.warn("[THYMELEAF] An Ajax request was detected, but no fragments were specified to be re-rendered.  "
                        + "Falling back to full page render.  This can cause unpredictable results when processing "
View Full Code Here

  //override, super class does not handle ZK Ajax case
  protected void defaultHandleExecutionOutcome(String flowId, FlowExecutionOutcome outcome,
      ServletExternalContext context, HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    if (!context.isResponseComplete()) {
      final AjaxHandler ajaxHandler = getAjaxHandler();
      if (ajaxHandler.isAjaxRequest(request, response)) {
        final String url = getFlowUrlHandler().createFlowDefinitionUrl(flowId, outcome.getOutput(), request);
        ajaxHandler.sendAjaxRedirect(url, request, response, false);
      } else {
        super.defaultHandleExecutionOutcome(flowId, outcome, context, request, response);
      }
    }
  }
View Full Code Here

    assertNotNull(this.handlerAdapter.getAjaxHandler());
    assertTrue(this.handlerAdapter.getAjaxHandler() instanceof JsfAjaxHandler);
  }

  public void testAjaxHandlerProvided() throws Exception {
    AjaxHandler myAjaxHandler = new SpringJavascriptAjaxHandler();
    this.handlerAdapter.setAjaxHandler(myAjaxHandler);
    this.handlerAdapter.afterPropertiesSet();
    assertTrue(myAjaxHandler == this.handlerAdapter.getAjaxHandler());
  }
View Full Code Here

TOP

Related Classes of org.springframework.js.ajax.AjaxHandler

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.