文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学的各位小编整理了其他类别-jeecms加载首页的过程的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
刚开始研究jeecms的时候很纳闷,找不到首页的加载页面。经过一番仔细研究,发现这个加载还是经过了很多曲折的过程的。整个程序的架构是ssh+freemarker模板构成的,所以先要熟悉freemarker模板技术。 先看web.xml文件,其中欢迎页面有:<welcome-file-list> <welcome-file>index.jspa</welcome-file> <welcome-file>index.do</welcome-file> <welcome-file>index.html</welcome-file> </welcome-file-list> <welcome-file-list><welcome-file>index.jspa</welcome-file><welcome-file>index.do</welcome-file><welcome-file>index.html</welcome-file></welcome-file-list> 接着再看jeecms/core/struts-front.xml配置文件,发现有个action的通用配置: <action name="**" class="core.dynamicSystemAct"> <result type="chain"> <param name="namespace">${namespace}</param> <param name="actionName">${actionName}</param> </result> <interceptor-ref name="exception"/> <interceptor-ref name="domain"/> <interceptor-ref name="cookieIdentity"/> <interceptor-ref name="url"/> </action> <action name="**" class="core.dynamicSystemAct"> <result type="chain"> <param name="namespace">${namespace}</param> <param name="actionName">${actionName}</param> </result> <interceptor-ref name="exception"/> <interceptor-ref name="domain"/> <interceptor-ref name="cookieIdentity"/> <interceptor-ref name="url"/> </action> struts收到请求以后,将请求转发到core.dynamicSystemAct这个对象,注意这个这个class并不是真正的类,是类的别名,由spring通过标注@Controller进行绑定,web应用上下文可以通过classpath自动扫描到这个类。 view plaincopy to clipboardprint?@Controller("core.dynamicSystemAct") public class DynamicSystemAct @Controller("core.dynamicSystemAct")public class DynamicSystemAct 在这个action执行之前,先要执行好几个拦截器。其他struts和webwork自带的拦截器不必说,主要说一下在程序里面自定义的几个比较重要的拦截器(定义在jeecms/src/struts-default.xml文件中)。 DomainNameInterceptor UrlIntercepto