class AjaxThymeleafView extends ThymeleafView implements AjaxEnabledView {

    private static final Logger vlogger = LoggerFactory.getLogger(AjaxThymeleafView.class);

    private static final String FRAGMENTS_PARAM = "fragments";


    private AjaxHandler ajaxHandler = null;



    public AjaxThymeleafView() {
        super();
    }



    public AjaxHandler getAjaxHandler() {
        return this.ajaxHandler;
    }


    public void setAjaxHandler(final AjaxHandler ajaxHandler) {
        this.ajaxHandler = ajaxHandler;
    }




    @Override
    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 Set<String> fragmentsToRender = getRenderFragments(model, request, response);
            if (fragmentsToRender == null || fragmentsToRender.size() == 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 "
                        + "the ajax response on the client.");
                super.render(model, request, response);
                return;
            }

            super.renderFragment(fragmentsToRender, model, request, response);

        } else {

            super.render(model, request, response);

        }

    }




    @SuppressWarnings({ "rawtypes", "unused" })
    protected Set<String> getRenderFragments(
            final Map model, final HttpServletRequest request, final HttpServletResponse response) {<FILL_FUNCTION_BODY>}



}

        final String fragmentsParam = request.getParameter(FRAGMENTS_PARAM);
        final String[] renderFragments = StringUtils.commaDelimitedListToStringArray(fragmentsParam);
        if (renderFragments.length == 0) {
            return null;
        }
        if (renderFragments.length == 1) {
            return Collections.singleton(renderFragments[0]);
        }
        return new HashSet<String>(Arrays.asList(renderFragments));
    
<methods>public void <init>() ,public void <init>(java.lang.String) ,public java.lang.String getMarkupSelector() ,public void render(Map<java.lang.String,?>, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) throws java.lang.Exception,public void setMarkupSelector(java.lang.String) <variables>private Set<java.lang.String> markupSelectors,private static final non-sealed java.lang.String pathVariablesSelector