>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>欢迎转载,转载请注明出处-VirgoArt,www.cnblogs.com

一、POM

  1. <dependency>
  2. <groupId>commons-digester</groupId>
  3. <artifactId>commons-digester</artifactId>
  4. <version>2.1</version>
  5. </dependency>

二、XML文件准备

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <webTemplate-methods>
  3. <method>
  4. <name>toListJSP</name>
  5. <id>toListJSP</id>
  6. <discribe>
  7. 列表页面跳转Controller
  8. </discribe>
  9. <jimport>
  10. org.springframework.web.bind.annotation.RequestMapping;
  11. org.springframework.web.bind.annotation.RequestMethod;
  12. </jimport>
  13. <jbean></jbean>
  14. <comment>
  15. /**
  16. *
  17. **/
  18. </comment>
  19. <body>
  20. <![CDATA[
  21. @RequestMapping(value = "/to${className?cap_first}ListJSP",method =RequestMethod.GET)
  22. public String to${className?cap_first}ListJSP()
  23. {
  24. return "${className}/${className}ListJSP";
  25. }
  26. ]]>
  27. </body>
  28. </method>
  29. <method>
  30. <name>searchListMethod</name>
  31. <id>searchListMethod</id>
  32. <discribe>
  33. 列表数据查询Controller
  34. </discribe>
  35. <jimport>
  36. java.util.Map;
  37. java.util.HashMap;
  38. org.springframework.web.bind.annotation.RequestMapping;
  39. org.springframework.web.bind.annotation.RequestMethod;
  40. org.springframework.web.bind.annotation.ResponseBody;
  41. </jimport>
  42. <jbean>
  43. private ${packagePath}.service.${className?cap_first}Service ${className}Service;
  44. </jbean>
  45. <comment>
  46. /**
  47. *
  48. **/
  49. </comment>
  50. <body>
  51. <![CDATA[
  52. @RequestMapping(value = "/searchListMethod", method = RequestMethod.GET)
  53. @ResponseBody
  54. public Map<String, Object> search${className?cap_first}ListMethod()
  55. {
  56. Map<String , Object> map = new HashMap<String , Object>();
  57. map.put("list",${className}Service.queryAll());
  58. return map;
  59. }
  60. ]]>
  61. </body>
  62. </method>
  63. <method>
  64. <name>toAddJSP</name>
  65. <id>toAddJSP</id>
  66. <discribe>
  67. 数据添加页面跳转Controller
  68. </discribe>
  69. <jimport>
  70. org.springframework.web.bind.annotation.RequestMapping;
  71. org.springframework.web.bind.annotation.RequestMethod;
  72. </jimport>
  73. <jbean></jbean>
  74. <comment>
  75. /**
  76. *
  77. **/
  78. </comment>
  79. <body>
  80. <![CDATA[
  81. @RequestMapping(value = "/toAdd${className?cap_first}JSP",method = RequestMethod.GET)
  82. public String toAdd${className?cap_first}JSP()
  83. {
  84. return "${className}/${className}AddJSP";
  85. }
  86. ]]>
  87. </body>
  88. </method>
  89. <method>
  90. <name>addMethod</name>
  91. <id>addMethod</id>
  92. <discribe>
  93. 数据添加处理Controller
  94. </discribe>
  95. <jimport>
  96. java.util.Map;
  97. java.util.HashMap;
  98. org.springframework.web.bind.annotation.RequestMapping;
  99. org.springframework.web.bind.annotation.RequestMethod;
  100. org.springframework.web.bind.annotation.RequestBody;
  101. org.springframework.web.bind.annotation.ResponseBody;
  102. </jimport>
  103. <jbean>
  104. private ${packagePath}.service.${className?cap_first}Service ${className}Service;
  105. </jbean>
  106. <comment>
  107. /**
  108. *
  109. **/
  110. </comment>
  111. <body>
  112. <![CDATA[
  113. @RequestMapping(value = "/add${className?cap_first}Method",method =RequestMethod.POST)
  114. @ResponseBody
  115. public Map<String, Object> add${className?cap_first}Method(@RequestBody ${packagePath}.entity.${className?cap_first} ${className})
  116. {
  117. Map <String ,Object> map =new HashMap<String ,Object>();
  118. int flag = ${className}Service.add(${className});
  119. if(flag>0){
  120. map.put("msg","SUCCESS");
  121. }else{
  122. map.put("msg","FAILED");
  123. }
  124. return map;
  125. }
  126. ]]>
  127. </body>
  128. </method>
  129. <method>
  130. <name>toUpdateJSP</name>
  131. <id>toUpdateJSP</id>
  132. <discribe>
  133. 数据更新页面跳转Controller
  134. </discribe>
  135. <jimport>
  136. org.springframework.web.bind.annotation.RequestMapping;
  137. org.springframework.web.bind.annotation.RequestMethod;
  138. </jimport>
  139. <jbean></jbean>
  140. <comment>
  141. /**
  142. *
  143. **/
  144. </comment>
  145. <body>
  146. <![CDATA[
  147. @RequestMapping(value = "/toUpdate${className?cap_first}JSP",method =RequestMethod.GET)
  148. public String toUpdate${className?cap_first}JSP()
  149. {
  150. return "${className}/${className}UpdateJSP";
  151. }
  152. ]]>
  153. </body>
  154. </method>
  155. <method>
  156. <name>queryByIdMethod</name>
  157. <id>queryByIdMethod</id>
  158. <discribe>
  159. 数据更新页面数据获取Controller
  160. </discribe>
  161. <jimport>
  162. org.springframework.web.bind.annotation.RequestMapping;
  163. org.springframework.web.bind.annotation.RequestMethod;
  164. org.springframework.web.bind.annotation.ResponseBody;
  165. </jimport>
  166. <jbean>
  167. private ${packagePath}.service.${className?cap_first}Service ${className}Service;
  168. </jbean>
  169. <comment>
  170. /**
  171. *
  172. **/
  173. </comment>
  174. <body>
  175. <![CDATA[
  176. @RequestMapping(value = "/query${className?cap_first}ByIdMethod",method =RequestMethod.GET)
  177. @ResponseBody
  178. public Map<String,Object> query${className?cap_first}ByIdMethod(Integer id)
  179. {
  180. Map <String ,Object> map = new HashMap<String, Object>();
  181. map.put("data",${className}Service.queryById(id));
  182. return map;
  183. }
  184. ]]>
  185. </body>
  186. </method>
  187. <method>
  188. <name>updateMethod</name>
  189. <id>updateMethod</id>
  190. <discribe>
  191. 数据更新处理Controller
  192. </discribe>
  193. <jimport>
  194. java.util.Map;
  195. java.util.HashMap;
  196. org.springframework.web.bind.annotation.RequestMapping;
  197. org.springframework.web.bind.annotation.RequestMethod;
  198. org.springframework.web.bind.annotation.RequestBody;
  199. org.springframework.web.bind.annotation.ResponseBody;
  200. </jimport>
  201. <jbean>
  202. private ${packagePath}.service.${className?cap_first}Service ${className}Service;
  203. </jbean>
  204. <comment>
  205. /**
  206. *
  207. **/
  208. </comment>
  209. <body>
  210. <![CDATA[
  211. @RequestMapping(value = "/update${className?cap_first}Method",method =RequestMethod.POST)
  212. @ResponseBody
  213. public Map<String, Object> update${className?cap_first}Method(@RequestBody ${packagePath}.entity.${className?cap_first} ${className})
  214. {
  215. Map <String ,Object> map = new HashMap<String, Object>();
  216. int flag =${className}Service.update(${className});
  217. if(flag>0){
  218. map.put("msg","SUCCESS");
  219. }else{
  220. map.put("msg","FAILED");
  221. }
  222. return map;
  223. }
  224. ]]>
  225. </body>
  226. </method>
  227. <method>
  228. <name>deleteMethod</name>
  229. <id>deleteMethod</id>
  230. <discribe>
  231. 数据删除处理Controller
  232. </discribe>
  233. <jimport>
  234. java.util.Map;
  235. java.util.HashMap;
  236. org.springframework.web.bind.annotation.RequestMapping;
  237. org.springframework.web.bind.annotation.RequestMethod;
  238. org.springframework.web.bind.annotation.RequestParam;
  239. org.springframework.web.bind.annotation.ResponseBody;
  240. </jimport>
  241. <jbean>
  242. private ${packagePath}.service.${className?cap_first}Service ${className}Service;
  243. </jbean>
  244. <comment>
  245. /**
  246. *
  247. **/
  248. </comment>
  249. <body>
  250. <![CDATA[
  251. @RequestMapping(value = "/delete${className?cap_first}Method",method =RequestMethod.GET)
  252. @ResponseBody
  253. public Map<String, Object> delete${className?cap_first}Method(@RequestParam String id)
  254. {
  255. Map <String ,Object> map = new HashMap<String ,Object>();
  256. int flag = ${className}Service.delete(Integer.parseInt(id));
  257. if(flag>0){
  258. map.put("msg","SUCCESS");
  259. }else{
  260. map.put("msg","FAILED");
  261. }
  262. return map;
  263. }
  264. ]]>
  265. </body>
  266. </method>
  267.  
  268. <method>
  269. <name>deletesMethod</name>
  270. <id>deletesMethod</id>
  271. <discribe>
  272. 数据批量删除处理Controller
  273. </discribe>
  274. <jimport>
  275. java.util.Map;
  276. java.util.HashMap;
  277. org.springframework.web.bind.annotation.RequestMapping;
  278. org.springframework.web.bind.annotation.RequestMethod;
  279. org.springframework.web.bind.annotation.RequestParam;
  280. org.springframework.web.bind.annotation.ResponseBody;
  281. </jimport>
  282. <jbean>
  283. private ${packagePath}.service.${className?cap_first}Service ${className}Service;
  284. </jbean>
  285. <comment>
  286. /**
  287. *
  288. **/
  289. </comment>
  290. <body>
  291. <![CDATA[
  292. @RequestMapping(value = "/deletes${className?cap_first}Method",method =RequestMethod.GET)
  293. @ResponseBody
  294. public Map<String, Object> deletes${className?cap_first}Method(@RequestParam List<Integer> ids)
  295. {
  296. Map <String ,Object> map = new HashMap<String ,Object>();
  297. int flag = ${className}Service.deletes(ids);
  298. map.put("msg","SUCCESS");
  299. return map;
  300. }
  301. ]]>
  302. </body>
  303. </method>
  304.  
  305. <method>
  306. <name>fileDownLoadMethod</name>
  307. <id>fileDownLoadMethod</id>
  308. <discribe>
  309. 文件下载Controller
  310. </discribe>
  311. <jimport>
  312. java.io.FileInputStream;
  313. java.io.IOException;
  314. java.io.InputStream;
  315. java.io.OutputStream;
  316. org.springframework.web.bind.annotation.RequestMapping;
  317. org.springframework.web.bind.annotation.RequestMethod;
  318. javax.servlet.http.HttpServletRequest;
  319. javax.servlet.http.HttpServletResponse;
  320. org.springframework.web.context.ContextLoader;
  321. cn.com.panji.common.util.FileUtils;
  322. </jimport>
  323. <jbean>
  324.  
  325. </jbean>
  326. <comment>
  327. /**
  328. *
  329. **/
  330. </comment>
  331. <body>
  332. <![CDATA[
  333. @RequestMapping(value ="/${className}/FileDownLoadMethod",method =RequestMethod.GET)
  334. public void fileDownLoadMethod(HttpServletRequest request, HttpServletResponse response) {
  335. String filePath = (String)request.getParameter("filepath");
  336. String fileName = (String)request.getParameter("filename");
  337. response.setContentType(ContextLoader.getCurrentWebApplicationContext().getServletContext().getMimeType(fileName));
  338. response.setHeader("Content-Disposition","attachment;filename*=utf-8'zh_cn'" + fileName);
  339. try {
  340. InputStream in =new FileInputStream(filePath);
  341. OutputStream out = response.getOutputStream();
  342. int b;
  343. while ((b = in.read()) != -1) {
  344. out.write(b);
  345. }
  346. in.close();
  347. out.flush();
  348. out.close();
  349. } catch (IOException e) {
  350. e.printStackTrace();
  351. }
  352. }
  353. ]]>
  354. </body>
  355. </method>
  356. <method>
  357. <name>fileUpLoadMethod</name>
  358. <id>fileUpLoadMethod</id>
  359. <discribe>
  360. 文件上传Controller
  361. </discribe>
  362. <jimport>
  363. java.io.File;
  364. java.util.HashMap;
  365. java.util.Map;
  366. org.springframework.web.bind.annotation.RequestMapping;
  367. org.springframework.web.bind.annotation.RequestMethod;
  368. org.springframework.web.bind.annotation.RequestParam;
  369. javax.servlet.http.HttpServletRequest;
  370. javax.servlet.http.HttpServletResponse;
  371. org.springframework.web.multipart.MultipartFile;
  372. cn.com.panji.common.util.FileUtils;
  373. </jimport>
  374. <jbean>
  375.  
  376. </jbean>
  377. <comment>
  378. /**
  379. *
  380. **/
  381. </comment>
  382. <body>
  383. <![CDATA[
  384. @RequestMapping(value ="/${className?cap_first}/FileUpLoadMethod",method= RequestMethod.GET)
  385. @ResponseBody
  386. public Map<String ,Object>fileUpLoadMethod(HttpServletRequest request,HttpServletResponse response,@RequestParam("file") MultipartFile file) {
  387. Map<String ,Object> map = new HashMap<String ,Object>();
  388. File saveFile =FileUtils.saveFile(file, FileUtils.getRootPath(this) + "/loadFile/");
  389. if(null!=saveFile){
  390. map.put("msg","SUCCESS");
  391. }else{
  392. map.put("msg","FAILED");
  393. }
  394. return map;
  395. }
  396. ]]>
  397. </body>
  398. </method>
  399.  
  400. <method>
  401. <name>searchByIdMethod</name>
  402. <id>searchByIdMethod</id>
  403. <discribe>
  404. 数据查询--By Id--Controller
  405. </discribe>
  406. <jimport>
  407. java.util.Map;
  408. java.util.HashMap;
  409. org.springframework.web.bind.annotation.RequestMapping;
  410. org.springframework.web.bind.annotation.RequestMethod;
  411. org.springframework.web.bind.annotation.ResponseBody;
  412. </jimport>
  413. <jbean>
  414. private ${packagePath}.service.${className?cap_first}Service ${className}Service;
  415. </jbean>
  416. <comment>
  417. /**
  418. *
  419. **/
  420. </comment>
  421. <body>
  422. <![CDATA[
  423. @RequestMapping(value = "/searchByIdMethod", method = RequestMethod.GET)
  424. @ResponseBody
  425. public Map<String, Object> search${className?cap_first}ByIdMethod(@RequestParam String id)
  426. {
  427. Map<String , Object> map = new HashMap();
  428. map.put("data",${className}Service.queryById(Integer.parseInt(id)));
  429. return map;
  430. }
  431. ]]>
  432. </body>
  433. </method>
  434. </webTemplate-methods>

三、创建映射对象

  1. package cn.com.panji.common.resourcemanager.bean.web;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import lombok.Data;
  7.  
  8. /** Web资源文件方法集合
  9. *
  10. * @author */
  11. @Data
  12. public class WebTemplateMethods {
  13. private List<WebTemplateMethod> methods = new ArrayList<>();
  14.  
  15. public List<WebTemplateMethod> getMethods() {
  16. return methods;
  17. }
  18.  
  19. public void setMethods(List<WebTemplateMethod> methods) {
  20. this.methods = methods;
  21. }
  22.  
  23. public void addWebTemplateMethod(WebTemplateMethod method) {
  24. methods.add(method);
  25. }
  26. }

集合类

  1. package cn.com.panji.common.resourcemanager.bean.web;
  2.  
  3. import java.util.Arrays;
  4. import java.util.List;
  5.  
  6. import cn.com.panji.common.util.StringUtils;
  7. import lombok.Data;
  8.  
  9. /** Web资源文件方法实体
  10. *
  11. * @author */
  12. @Data
  13. public class WebTemplateMethod {
  14.  
  15. private String name;
  16. private String discribe;
  17. private String id;
  18.  
  19. private String comment;
  20. private String jimport;
  21. private String jbean;
  22. private String body;
  23.  
  24. public String getBody() {
  25. // body.replace("&lt;", "<");
  26. // body.replace("&gt;", ">");
  27. return body;
  28. }
  29.  
  30. public void setBody(String body) {
  31. this.body = body;
  32. }
  33.  
  34. public String getDiscribe() {
  35. return discribe;
  36. }
  37.  
  38. public void setDiscribe(String discribe) {
  39. this.discribe = discribe;
  40. }
  41.  
  42. public String getComment() {
  43. return comment;
  44. }
  45.  
  46. public void setComment(String comment) {
  47. this.comment = comment;
  48. }
  49.  
  50. public String getName() {
  51. return name;
  52. }
  53.  
  54. public void setName(String name) {
  55. this.name = name;
  56. }
  57.  
  58. public String getJimport() {
  59. return jimport;
  60. }
  61.  
  62. public List<String> getJimportList() {
  63. jimport = StringUtils.removeAllBlank(jimport);
  64. return Arrays.asList(jimport.split(";"));
  65. }
  66.  
  67. public void setJimport(String jimport) {
  68. this.jimport = jimport;
  69. }
  70.  
  71. public String getJbean() {
  72. return jbean;
  73. }
  74.  
  75. public List<String> getJbeanList() {
  76. jbean = StringUtils.trim(jbean);
  77. return Arrays.asList(jbean.split(";"));
  78. }
  79.  
  80. public void setJbean(String jbean) {
  81. this.jbean = jbean;
  82. }
  83.  
  84. public String getId() {
  85. return id;
  86. }
  87.  
  88. public void setId(String id) {
  89. this.id = id;
  90. }
  91.  
  92. }

封装类

四、Digester解析配置与应用

  1. package cn.com.panji.common.resourcemanager.api.impl;
  2.  
  3. import java.io.IOException;
  4. import java.util.ArrayList;
  5. import java.util.Arrays;
  6. import java.util.HashMap;
  7. import java.util.List;
  8. import java.util.Map;
  9.  
  10. import org.apache.commons.digester.Digester;
  11. import org.xml.sax.SAXException;
  12.  
  13. import cn.com.panji.common.resourcemanager.ResourceEnum;
  14. import cn.com.panji.common.resourcemanager.api.TemplateXMLReader;
  15. import cn.com.panji.common.resourcemanager.bean.web.WebTemplateMethod;
  16. import cn.com.panji.common.resourcemanager.bean.web.WebTemplateMethods;
  17.  
  18. public class WebTemplateXMLReader extends TemplateXMLReader {
  19. static final String WEB_TEMPLEATE_XML_PATH = "resourceTemplates/"
  20. + ResourceEnum.XML_TEMPLATE_WEB.getResourceTemplatePath() + ".xml";
  21. private WebTemplateMethods methods = null;
  22.  
  23. private WebTemplateXMLReader() {
  24. configDigester();
  25. parse();
  26. }
  27.  
  28. @Override
  29. public void configDigester() {
  30. this.digester = new Digester();
  31. this.digester.setValidating(false);
  32. // 配置映射
  33. this.digester.addObjectCreate("webTemplate-methods", WebTemplateMethods.class);
  34. this.digester.addObjectCreate("webTemplate-methods/method", WebTemplateMethod.class);
  35.  
  36. this.digester.addBeanPropertySetter("webTemplate-methods/method/name", "name");
  37. this.digester.addBeanPropertySetter("webTemplate-methods/method/id", "id");
  38. this.digester.addBeanPropertySetter("webTemplate-methods/method/discribe", "discribe");
  39. this.digester.addBeanPropertySetter("webTemplate-methods/method/jimport", "jimport");
  40. this.digester.addBeanPropertySetter("webTemplate-methods/method/jbean", "jbean");
  41. this.digester.addBeanPropertySetter("webTemplate-methods/method/comment", "comment");
  42. this.digester.addBeanPropertySetter("webTemplate-methods/method/body", "body");
  43.  
  44. this.digester.addSetNext("webTemplate-methods/method", "addWebTemplateMethod");
  45. }
  46.  
  47. @Override
  48. public void parse() {
  49. try {
  50. methods = (WebTemplateMethods) this.digester
  51. .parse(this.getClass().getClassLoader().getResourceAsStream(WEB_TEMPLEATE_XML_PATH));
  52. } catch (IOException | SAXException e) {
  53. e.printStackTrace();
  54. }
  55. }
  56.  
  57. @Override
  58. public WebTemplateMethod findResource(String id) {
  59. for (WebTemplateMethod m : methods.getMethods()) {
  60. if (id.equals(m.getId())) {
  61. return m;
  62. }
  63. }
  64. return null;
  65. }
  66.  
  67. @Override
  68. public Object findResourceMap(String[] ids) {
  69. Map<String, WebTemplateMethod> map = new HashMap<>();
  70. List<String> idList = Arrays.asList(ids);
  71. for (WebTemplateMethod m : methods.getMethods()) {
  72. if (idList.contains(m.getId())) {
  73. map.put(m.getId(), m);
  74. }
  75. }
  76. return map;
  77. }
  78.  
  79. @Override
  80. public Object findResourceList(String[] ids) {
  81. List<WebTemplateMethod> list = new ArrayList<WebTemplateMethod>();
  82. List<String> idList = Arrays.asList(ids);
  83. for (WebTemplateMethod m : methods.getMethods()) {
  84. if (idList.contains(m.getId())) {
  85. list.add(m);
  86. }
  87. }
  88. return list;
  89. }
  90.  
  91. public static TemplateXMLReader getInstance() {
  92. return new WebTemplateXMLReader();
  93. }
  94. }
  1. WebTemplateMethod web = (WebTemplateMethod) TemplateReaderFactory.getTemplateXMLReaderInstance(ResourceEnum.XML_TEMPLATE_WEB).findResource("updateMethod");

五、解释及注意事项

  1.XML结构应与映射对象层次结构相同,解析时,可解析到最末端元素,关于List数据,使用事件驱动器进行反射,当扫描到元素时,调动相应的Add方法。

  2.Digester使用反射Setter方式进行属性注入,需要保证存在有效的Setter方法。

  3.项目中可用该方式实现更加清晰的项目参数配置文件以及解析。

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>关于节点属性数据获取等内容后续更新

XML数据读取——Digester简单使用的更多相关文章

  1. XML数据读取方式性能比较(一)

    原文:XML数据读取方式性能比较(一) 几个月来,疑被SOA,一直在和XML操作打交道,SQL差不多又忘光了.现在已经知道,至少有四种常用人XML数据操作方式(好像Java差不多),不过还没有实际比较 ...

  2. 以对象的方式来访问xml数据表(二)

    为什么要以对象的方式来访问xml数据表? 还记得,自己是在一次完成师兄布置的任务时接触到了xml,那时候需要用xml来作为数据文件,保存一个简单的图书管理系统的数据.于是就知道了,可以用xml文件来保 ...

  3. c#调用JAVA的Webservice处理XML数据及批量轮询的实现方法

    前段时间做一个调用外单位WEBSERVICE的项目,项目完成的功能其实很简单,就是我们单位有很多车友会员,我们想对他们提供车辆违章信息告之服务!我们这边交警部门给我们开放了WS的接口,我们就是想通过这 ...

  4. 使用dom4j中SAXReader解析xml数据

    public ApiConfig(String configFilePath) throws DocumentException{ SAXReader reader = new SAXReader() ...

  5. Extjs的数据读取器store和后台返回类型简单解析

    工作中用到了Extjs,从后台获取数据的时候,用到了extjs自己的Ext.data.store方法,然后封装了ExtGridReturn方法, 目的:前台用到Ext.data.store读取从后台传 ...

  6. InnerException 消息是“反序列化对象 属于类型 *** 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。(注意细节)

    WEB站点在调用我们WCF服务的时候,只要传入的参数过长,就报如下错误: 格式化程序尝试对消息反序列化时引发异常: 尝试对参数 http://tempuri.org/ 进行反序列化时出错: formD ...

  7. C#基础笔记---浅谈XML读取以及简单的ORM实现

    背景: 在开发ASP.NETMVC4 项目中,虽然web.config配置满足了大部分需求,不过对于某些特定业务,我们有时候需要添加新的配置文件来记录配置信息,那么XML文件配置无疑是我们选择的一个方 ...

  8. C#基础---浅谈XML读取以及简单的ORM实现

    背景: 在开发ASP.NETMVC4 项目中,虽然web.config配置满足了大部分需求,不过对于某些特定业务,我们有时候需要添加新的配置文件来记录配置信息,那么XML文件配置无疑是我们选择的一个方 ...

  9. XML教程、语法手册、数据读取方式大全

    XML简单易懂教程 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 一 XML --数据格式的写法 二 Re ...

随机推荐

  1. ubuntu下adb的使用以及开启黑域

    ubuntu使用adb开启黑域 刷了原生后经好友推荐, 黑域对于App的管控效果还是很不错的 adb的安装 此处顺带着就把fastboot也安装了 sudo apt update sudo apt i ...

  2. luogu5290 春节十二响

    题目链接 思路 先考虑一条链的情况怎么做. 因为只有两个子树,并且两个子树都是链.所以可以把这两条链找出来,然后\(sort\)一下.合并起来. 然后推广到树上 对于每一棵树都可以按照和上面同样的方法 ...

  3. C++预编译头文件 – stdafx.h

    预编译头文件的由来 也许请教了别的高手之后,他们会告诉你,这是预编译头,必须包含.可是,这到底是为什么呢?预编译头有什么用呢? 咱们从头文件的编译原理讲起.其实头文件并不神秘,其在编译时的作用,就是把 ...

  4. NPOI读取excel表,如果有公式取出的是公式,想要取数字怎么办?

    public static DataTable Import(string strFileName) { DataTable dt = new DataTable(); HSSFWorkbook hs ...

  5. fhq treap

    学了一下,好像明白了(背下来了) 不想写main函数了 PS:这个比treap好写(私以为) #include<bits/stdc++.h> using namespace std; in ...

  6. select中option的onclick事件失效

    html: <select id="pageSelect"> <option value="1" selected onclick=" ...

  7. 二、初始化superset

    上一步成功安装了superset, 1.初始化数据 创建命令 #创建管理员账号fabmanager create-admin --app superset#cd到superset 根目录参考路径 C: ...

  8. easyui 菜单树搜索

    //树形菜单搜索方法    function searchTree(treeObj,parentNode,searchCon){        var children;        for(var ...

  9. Android OS的image文件组成

    Android OS由以下image文件组成: 1)Bootloader ---在设备启动时开始加载Boot image 2)Boot image ---Kernel 和 RAMdisk 3)Syst ...

  10. 关于npm镜像,发布,内网搭建等

    npm config set registry http://registry.npmjs.org npm config set registry https://registry.npm.taoba ...