流程:
2.跳转到主页面index.jsp (需要包含ExtendLogic.jsp)
3.执行ExtendLogic.jsp
4.获得扩展类型 - 获得扩展的包含文件, 如testExtend.jspf
5.使用include包含扩展testExtend.jspf
<jsp:include page="../extends/testExtend.jspf" flush="true">
<jsp:param name="selfPath" value="../extends/testExtend.jspf" />
</jsp:include>
6.执行testExtend.jspf
7.for循环输出
temp = "<script type=\"text/javascript\" src=\""+temp+"\"></script>";
temp = "<link rel=\"stylesheet\" type=\"text/css\" href=\""+temp+"\"/>";
response.getWriter().println(temp);
8.在testExtend.js中
(function() {
DefineExtension({
points : {
Menu_extend : function( config ) {
var value = config.value;
}
}
});
})();
9. 在一个public属性的js中增加全局 extendFunctions = {} 进行记录
10.把需要执行的方法增加到extendFunctions //ex.points[name] is function
for( var name in ex.points) {
if( extendFunctions[name] ) {
extendFunctions[name].push(ex.points[name]);
} else {
extendFunctions[name] = [ex.points[name]];
}
}
8.执行扩展, 如果使用执行方法名"Menu_extend"能够从
Util = {
methods : {},
execute : function(methodName,config){
Util.methods[methodName](config);
}
}
Util.methods["Menu_extend"] = points.Menu_extend;
Util.execute("Menu_extend",{});

本文详细阐述了从登录到扩展执行的完整流程,并深入探讨了如何通过JSP页面实现扩展功能,包括页面跳转、扩展类型获取、扩展文件包含与执行过程。同时介绍了在公共JS文件中记录扩展功能并调用执行的实现方式。

被折叠的 条评论
为什么被折叠?



