thymeleaf 3定义标签怎样处理异步加载的标签元素

在springboot2+thymeleaf 3使用自定义标签时候;是在页面一加载就会去判断自定义标签的;可是有些的标签内容是异步加载过来的;加载完后没有去进行判断怎么办?

package com.netmarch.config;

import org.springframework.stereotype.Component;
import org.thymeleaf.dialect.AbstractProcessorDialect;
import org.thymeleaf.dialect.IProcessorDialect;
import org.thymeleaf.processor.IProcessor;
import org.thymeleaf.standard.StandardDialect;

import java.util.HashSet;
import java.util.Set;

/**
 * 自定义标签_声明方言
 * @author sly
 * @time 2019年1月24日
 */
@Component
public class MyTagDialect extends AbstractProcessorDialect implements IProcessorDialect {
    private static final String PREFIX = "mt";
    public MyTagDialect() {
        super("My tag", PREFIX, StandardDialect.PROCESSOR_PRECEDENCE);
    }
    @Override
    public Set<IProcessor> getProcessors(String dialectPrefix) {
        Set<IProcessor> processors = new HashSet<IProcessor>();
        processors.add(new MyTagProcessor(PREFIX));
        return processors;
    }

}

/**

  • 自定义标签_处理器
  • @author sly
  • @time 2019年1月24日
    */
    public class MyTagProcessor extends AbstractElementTagProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(MyTagProcessor.class);
    private static final int PRECEDENCE = 10000;
    private static final String TAG_NAME = "MyTag";
    public MyTagProcessor(String dialectPrefix) {
    super(
    // 此处理器将仅应用于HTML模式
    TemplateMode.HTML,
    // 要应用于名称的匹配前缀
    dialectPrefix,
    // 标签名称:匹配此名称的特定标签
    TAG_NAME,
    // 没有要应用于标签名称的前缀
    false,
    // 无属性名称:将通过标签名称匹配
    null,
    // 没有要应用于属性名称的前缀
    false,
    // 优先(内部方言自己的优先)
    PRECEDENCE);
    }

    @Override
    protected void doProcess(ITemplateContext context, IProcessableElementTag tag,
    IElementTagStructureHandler structureHandler) {
    //获取元素名称
    LOGGER.info(tag.getElementCompleteName());
    WebEngineContext context2 = (WebEngineContext)context;
    HttpServletRequest request = context2.getRequest();
    Set

    funs = (Set)request.getSession().getAttribute("funs");
    if(funs != null && funs.size() > 0){
    IAttribute funid = tag.getAttribute("funid");
    LOGGER.info("匹配上:" + funid.getValue());
    if (!funs.contains(funid.getValue())) {
    structureHandler.removeElement();
    }else {
    structureHandler.removeTags();
    }
    }else{
    structureHandler.removeElement();
    }
    }
    }

图片说明

就是这里的编辑删除的后续ajax异步加载过来的该怎样去后台doProcess中进行判断呢