struts2中的include的实现
来源:互联网 发布:seo如何做外链 编辑:程序博客网 时间:2024/04/30 04:21
通过读取源代码,发现struts2是通过Xwork中的XmlConfigurationProvider来读取配置的.其中发现在xwork2.1版本中,是支持*号的通配读取.但在xwork2.0中是不支持这样的写法.
所以在String2.1的版本中是可以使用<include file="resource/struts-config/*.xml"/>这样的配置.在Struts2.0中是不支持这样的配置
xwork2.1
xwork2.0
所以在String2.1的版本中是可以使用<include file="resource/struts-config/*.xml"/>这样的配置.在Struts2.0中是不支持这样的配置
xwork2.1
- if ("include".equals(nodeName)) {
- String includeFileName = child.getAttribute("file");
- if (includeFileName.indexOf('*') != -1) {
- // handleWildCardIncludes(includeFileName, docs, child);
- ClassPathFinder wildcardFinder = new ClassPathFinder();
- wildcardFinder.setPattern(includeFileName);
- Vector<String> wildcardMatches = wildcardFinder.findMatches();
- for (String match : wildcardMatches) {
- finalDocs.addAll(loadConfigurationFiles(match, child));
- }
- } else {
- finalDocs.addAll(loadConfigurationFiles(includeFileName, child));
- }
- }
xwork2.0
- Element rootElement = doc.getDocumentElement();
- NodeList children = rootElement.getChildNodes();
- int childSize = children.getLength();
- for (int i = 0; i < childSize; i++) {
- Node childNode = children.item(i);
- if (childNode instanceof Element) {
- Element child = (Element) childNode;
- final String nodeName = child.getNodeName();
- if (nodeName.equals("include")) {
- String includeFileName = child.getAttribute("file");
- docs.addAll(loadConfigurationFiles(includeFileName, child));
- }
- }
- }
- docs.add(doc);
- loadedFileUrls.add(url.toString());
- struts2中的include的实现
- struts2配置文件中的include问题
- struts2配置文件中的include和global-results
- struts2配置文件中的include和global-results
- struts2配置文件中的include和global-results
- Struts2中是如何实现include文件
- struts2第六讲线程安全和<struts>中的constant,include,package的小知识
- struts2中的<sd:datetimepiicker>标签的实现
- struts2 include标签传入参数的调用
- android中的include的使用
- struts2系列十一之 struts.xml中的include用法
- JSP中的include指令和include动作的区别
- jsp页面中的静态include和动态include的区别
- struts2 include 问题
- struts2 include 标签
- jsp:include 中包含struts2的action的解决办法
- 实现struts2的CRUD中的权限控制(一)
- 实现struts2的CRUD中的权限控制(二)
- 做人实用心理学
- tomcat 启动参数设置
- 浅析android应用增量升级
- 设计模式的一些瞎想
- PHP 整型
- struts2中的include的实现
- C/C++面试合集
- js:匿名与闭包函数
- java web 分页方法(数据库用MySQL)
- 初识JNI (ubuntu 12.04 +java 7)
- c++primer学习摘抄之一(第一章 开始)
- (经典)C语言测试:想成为嵌入式程序员应知道的0x10个基本问题
- java 泛型限定(下限)
- Sybase封锁原理(死锁)