All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ajaxanywhere.jsf.MyFacesClientStateSavingPreSendHandler Maven / Gradle / Ivy

Go to download

本项目主要弥补在使用mybatis3+springmvc+jquery easyui快速搭建web应用系统是遇到的框架不足. 主要工作包括: 1,扩展了ApplicationContextAware,通过单例注入spring容器,提供spring容器外的bean获取方法 2,扩展了apache shiro框架,统一了安全结构 3,扩展了mybatis3拦截器,在两个拦截器中自动完成分页注入,实现内存分页。 4,分页设计数据库方言 5,提供了一个easyuigrid的模型 6,提供了java泛型的jstl 7, xml工具包等一些小工具

There is a newer version: 1.1.10
Show newest version
package org.ajaxanywhere.jsf;

import org.ajaxanywhere.PreSendHandler;
import org.ajaxanywhere.BufferResponseWrapper;
import org.ajaxanywhere.AAUtils;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

public class MyFacesClientStateSavingPreSendHandler implements PreSendHandler {
    private static final String TREE_KEY = "\n");
                if (state != null) responseWrapper.output("    var state = AjaxAnywhere.findInstance(aaInstanceId).findForm().elements[\"jsf_state_64\"]\n" +
                        "    if (state!=null && state.tagName.toLowerCase() == \"input\")\n" +
                        "                state.value=\"" + state + "\";"
                );
                if (tree != null) responseWrapper.output("    var tree = AjaxAnywhere.findInstance(aaInstanceId).findForm().elements[\"jsf_tree_64\"]\n" +
                        "    if (tree!=null && tree.tagName.toLowerCase() == \"input\")\n" +
                        "               tree.value=\"" + tree + "\";"
                );
                if (jsf_sequence != null) responseWrapper.output(
                        "   var jsf_sequence = AjaxAnywhere.findInstance(aaInstanceId).findForm().elements[\"jsf_sequence\"]\n" +
                        "    if (jsf_sequence!=null && jsf_sequence.tagName.toLowerCase() == \"input\")\n" +
                        "               jsf_sequence.value=\"" + jsf_sequence + "\";");
                responseWrapper.output("" + AAUtils.getZoneEndDelimiter(ZONE_NAME));
                AAUtils.addZonesToRefresh(request, ZONE_NAME);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        return responseWrapper;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy