{"id":1838,"date":"2012-09-12T01:00:00","date_gmt":"2012-09-12T01:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/apache-digester-example-make-easy-configuration.html"},"modified":"2012-10-22T06:55:43","modified_gmt":"2012-10-22T06:55:43","slug":"apache-digester-example-make-easy","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html","title":{"rendered":"Apache Digester Example &#8211; Make Easy Configuration"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">Address Problem &#8211; Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just by changing the file.&nbsp;Apache Digester can do it for you easily.<\/p>\n<p>Transforming an XML document into a corresponding hierarchy of Java bean objects is a fairly easy using Apache Digester. See Digester in action below.<br \/>\nDigester introduces three important concepts:                                            <\/p>\n<ol>\n<li>element matching patterns<\/li>\n<li>processing rules<\/li>\n<li> the object stack.<\/li>\n<\/ol>\n<p><i>Element matching patterns<\/i>                     associate XML elements with processing rules.<\/p>\n<p>Example :<br \/>\nWhat you have: <\/p>\n<ol style=\"text-align: left\">\n<li>Java Classes<\/li>\n<li>XML files containing data<\/li>\n<\/ol>\n<p>You have java classes and corresponding xml files. You want java classses instances to be created from xml data.                                                                   <\/p>\n<p>What extra code you need to write.<br \/>\nStep by step tasks: <\/p>\n<ol style=\"text-align: left\">\n<li>Add Apache Digester 3 jar file, Commons logging jar, Beanutils jar,cglib jar in your class path<\/li>\n<li>If don&#8217;t have the java classes, create java classes for corresponding xml file.Or if don&#8217;t have xml files, create it as per the java classes.Note- property name,hierarchy  in xml and java class should match, otherwise you need to provide mapping in your digester xml rule not mentioned here.<\/li>\n<li>Create a digester rule xml file as mentioned in the example below<\/li>\n<li>Use few lines of to load java objects from xml<\/li>\n<\/ol>\n<p>Now In Action &#8211;                      <\/p>\n<p>Here is my eclipse project structure :                      <\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-XNFqlcTGguo\/UE-bjiNfWUI\/AAAAAAAACCI\/WMc6gk0sFqQ\/s1600\/download.png\"><img decoding=\"async\" border=\"0\" height=\"320\" src=\"http:\/\/1.bp.blogspot.com\/-XNFqlcTGguo\/UE-bjiNfWUI\/AAAAAAAACCI\/WMc6gk0sFqQ\/s320\/download.png\" width=\"279\" \/><\/a><\/div>\n<p><strong>Task 2 <\/strong>&#8211;                                           <strong> create data xml file as below you want data from which to be loaded<\/strong>                      <strong> say &#8211; chain-config.xml<\/strong><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n\r\n&lt;catalogs&gt;\r\n\r\n    &lt;!-- Default Catalog: \"Path Info\" example --&gt;\r\n    &lt;catalog&gt;\r\n\r\n        &lt;!-- Command that maps \"Path Info\" patterns to Commands --&gt;\r\n        &lt;chain name=\"COMMAND_MAPPER\"&gt;\r\n            &lt;command                       className=\"org.apache.commons.chain.web.servlet.PathInfoMapper\"\/&gt;\r\n            &lt;command forward=\"\/pathinfo.jsp\"  className=\"org.apache.commons.chain.apps.example.ForwardCommand\"\/&gt;\r\n        &lt;\/chain&gt;\r\n\r\n        &lt;!-- Foo Command --&gt;\r\n        &lt;chain name=\"\/foo\"&gt;\r\n            &lt;command attribute=\"pathinfoFooCount\" className=\"org.apache.commons.chain.apps.example.CountCommand\"\/&gt;\r\n        &lt;\/chain&gt;\r\n\r\n        &lt;!-- Bar Command --&gt;\r\n        &lt;chain name=\"\/bar\"&gt;\r\n            &lt;command attribute=\"pathinfoBarCount\" className=\"org.apache.commons.chain.apps.example.CountCommand\"\/&gt;\r\n        &lt;\/chain&gt;\r\n\r\n    &lt;\/catalog&gt;\r\n\r\n    &lt;!-- Catalog for \"Request Parameter\" example --&gt;\r\n    &lt;catalog name=\"reqparam\"&gt;\r\n\r\n        &lt;!-- Command that maps a \"Request Parameter\" to Commands --&gt;\r\n        &lt;chain name=\"COMMAND_MAPPER\"&gt;\r\n            &lt;command catalogName=\"reqparam\"  className=\"org.apache.commons.chain.web.servlet.RequestParameterMapper\"\/&gt;\r\n            &lt;command forward=\"\/reqparam.jsp\" className=\"org.apache.commons.chain.apps.example.ForwardCommand\"\/&gt;\r\n        &lt;\/chain&gt;\r\n\r\n        &lt;!-- Foo Command --&gt;\r\n        &lt;chain name=\"foo\"&gt;\r\n            &lt;command attribute=\"reqparamFooCount\" className=\"org.apache.commons.chain.apps.example.CountCommand\"\/&gt;\r\n        &lt;\/chain&gt;\r\n\r\n        &lt;!-- Bar Command --&gt;\r\n        &lt;chain name=\"bar\"&gt;\r\n            &lt;command attribute=\"reqparamBarCount\" className=\"org.apache.commons.chain.apps.example.CountCommand\"\/&gt;\r\n        &lt;\/chain&gt;\r\n\r\n    &lt;\/catalog&gt;\r\n\r\n&lt;\/catalogs&gt;\r\n<\/pre>\n<p><strong><br \/>\n<\/strong><strong>Create corresponding java classses<\/strong>                                             <strong> Catalog.java :<\/strong><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">import java.util.ArrayList;\r\nimport java.util.List;\r\n\r\n\r\n\r\npublic class Catalog {\r\n\r\n    \/**\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    private String name;\r\n\r\n    \/**\r\n     * Getter of the property &lt;tt&gt;name&lt;\/tt&gt;\r\n     * @return  Returns the name.\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    public String getName() {\r\n        return name;\r\n    }\r\n\r\n    \/**\r\n     * Setter of the property &lt;tt&gt;name&lt;\/tt&gt;\r\n     * @param name  The name to set.\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    public void setName(String name) {\r\n        this.name = name;\r\n    }\r\n\r\n    \/**\r\n     * @uml.property  name=\"chains\"\r\n     *\/\r\n    \r\n    private List&lt;Chain&gt; chains=new ArrayList&lt;Chain&gt;();\r\n    \r\n    public void addChains(Chain chain)\r\n    {\r\n        this.chains.add(chain);\r\n    }\r\n\r\n}\r\n<\/pre>\n<p><strong><br \/>\n<\/strong><strong>Chain.java :<\/strong><\/p>\n<pre class=\"brush:java\">import java.util.ArrayList;\r\nimport java.util.List;\r\n\r\n\r\n\r\npublic class Chain {\r\n\r\n    \/**\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    private String name;\r\n\r\n    \/**\r\n     * Getter of the property &lt;tt&gt;name&lt;\/tt&gt;\r\n     * @return  Returns the name.\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    public String getName() {\r\n        return name;\r\n    }\r\n\r\n    \/**\r\n     * Setter of the property &lt;tt&gt;name&lt;\/tt&gt;\r\n     * @param name  The name to set.\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    public void setName(String name) {\r\n        this.name = name;\r\n    }\r\n\r\n    \/**\r\n     * @uml.property  name=\"commands\"\r\n     *\/\r\n    private List&lt;Command&gt; commands=new ArrayList&lt;Command&gt;();\r\n    \r\n\r\n    \/**\r\n     * Setter of the property &lt;tt&gt;commands&lt;\/tt&gt;\r\n     * @param commands  The commands to set.\r\n     * @uml.property  name=\"commands\"\r\n     *\/\r\n    public void addCommands(Command command) {\r\n        this.commands.add(command);\r\n    }\r\n\r\n}\r\n<\/pre>\n<p><strong><br \/>\n<\/strong><strong>Command.java :<\/strong><\/p>\n<pre class=\"brush:java\">import java.util.ArrayList;\r\nimport java.util.List;\r\n\r\n\r\n\r\npublic class Chain {\r\n\r\n    \/**\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    private String name;\r\n\r\n    \/**\r\n     * Getter of the property &lt;tt&gt;name&lt;\/tt&gt;\r\n     * @return  Returns the name.\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    public String getName() {\r\n        return name;\r\n    }\r\n\r\n    \/**\r\n     * Setter of the property &lt;tt&gt;name&lt;\/tt&gt;\r\n     * @param name  The name to set.\r\n     * @uml.property  name=\"name\"\r\n     *\/\r\n    public void setName(String name) {\r\n        this.name = name;\r\n    }\r\n\r\n    \/**\r\n     * @uml.property  name=\"commands\"\r\n     *\/\r\n    private List&lt;Command&gt; commands=new ArrayList&lt;Command&gt;();\r\n    \r\n    \/**\r\n     * Getter of the property &lt;tt&gt;commands&lt;\/tt&gt;\r\n     * @return  Returns the commands.\r\n     * @uml.property  name=\"commands\"\r\n     *\/\r\n    public List getCommands() {\r\n        return commands;\r\n    }\r\n\r\n    \/**\r\n     * Setter of the property &lt;tt&gt;commands&lt;\/tt&gt;\r\n     * @param commands  The commands to set.\r\n     * @uml.property  name=\"commands\"\r\n     *\/\r\n    public void addCommands(Command command) {\r\n        this.commands.add(command);\r\n    }\r\n\r\n}<\/pre>\n<p><strong>Task 3 &#8211; Create digester rules <\/strong>                                             <strong>digester-catalog-rules.xml<\/strong> <\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;!DOCTYPE digester-rules PUBLIC\r\n  \"-\/\/Apache Commons \/\/DTD digester-rules XML V1.0\/\/EN\"\r\n  \"http:\/\/commons.apache.org\/digester\/dtds\/digester-rules-3.0.dtd\"&gt;\r\n&lt;digester-rules&gt;\r\n\r\n  &lt;pattern value=\"catalogs\/catalog\"&gt;\r\n\r\n    &lt;object-create-rule classname=\"Catalog\"\/&gt;\r\n\r\n\r\n\r\n    &lt;set-properties-rule\/&gt;\r\n\r\n   &lt;!-- comment :\r\n\r\n  &lt;bean-property-setter-rule pattern=\"name\"\/&gt;  \r\n\r\nuse as shown above  if say  &lt;catalog&gt;&lt;name&gt;reparam&lt;\/name&gt; &lt;\/catalog&gt; instead of &lt;catalog name=\"reparam\"&gt; &lt;\/catalog&gt;\r\n\r\n--&gt;\r\n\r\n\r\n    \r\n\r\n    &lt;!-- Nested Pattern for Characters --&gt;\r\n\r\n    &lt;pattern value=\"chain\"&gt;\r\n\r\n      &lt;object-create-rule classname=\"Chain\"\/&gt;\r\n\r\n\r\n      &lt;set-properties-rule\/&gt;                 \r\n                     \r\n\r\n &lt;!-- Nested Pattern for Characters --&gt;\r\n                             &lt;pattern value=\"command\"&gt;\r\n\r\n      &lt;object-create-rule classname=\"Command\"\/&gt;\r\n\r\n\r\n                           &lt;set-properties-rule\/&gt;\r\n\r\n                          &lt;set-next-rule methodname=\"addCommands\"  paramtype=\"Command\"\/&gt;\r\n&lt;\/pattern&gt;\r\n      &lt;set-next-rule methodname=\"addChains\" paramtype=\"Chain\"\/&gt;\r\n&lt;\/pattern&gt;\r\n    &lt;set-next-rule methodname=\"add\" paramtype=\"Catalog\"\/&gt;\r\n&lt;\/pattern&gt;\r\n&lt;\/digester-rules&gt;<\/pre>\n<p><strong>Task 4 &#8211; Client program to load xml data<\/strong> <\/p>\n<pre class=\"brush:java\">import java.io.IOException;\r\nimport java.io.InputStream;\r\nimport java.net.URL;\r\n\r\nimport org.apache.commons.digester3.Digester;\r\nimport org.apache.commons.digester3.binder.DigesterLoader;\r\nimport org.apache.commons.digester3.xmlrules.FromXmlRulesModule;\r\nimport org.xml.sax.SAXException;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\npublic class runProgram {\r\n\r\n    \/**\r\n     * @param args\r\n     *\/\r\n    public static void main(String[] args) {\r\n        \/\/ TODO Auto-generated method stub\r\n\r\n        \r\n        \/\/ Create an instance of the Digester from the XML rule set\r\n\r\n\r\n\r\n        DigesterLoader  digesterLoader = DigesterLoader.newLoader(new FromXmlRulesModule() {\r\n            \r\n            @Override\r\n            protected void loadRules() {\r\n                \/\/ TODO Auto-generated method stub\r\n                loadXMLRules( getClass( ).getResource(\"\/com\/tatu\/resources\/digester-catalog-rules.xml\"));\r\n\r\n            }\r\n        });\r\nDigester digester = digesterLoader.newDigester();\r\n\r\nList&lt;Catalog&gt; catalogs = new ArrayList&lt;Catalog&gt;();\r\n\r\n        \/\/ Push a reference to the plays List on to the Stack\r\n\r\n        digester.push(catalogs);\r\n\r\n\r\n\r\n        \/\/ Parse the XML document\r\n\r\n        InputStream input = Digester.class.getClass().getResourceAsStream(\"\/com\/tatu\/resources\/chain-config.xml\");\r\n\r\n        try {\r\n            Object root = digester.parse(input);\r\n        } catch (IOException e) {\r\n            \/\/ TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        } catch (SAXException e) {\r\n            \/\/ TODO Auto-generated catch block\r\n            e.printStackTrace();\r\n        }\r\n\r\n    }\r\n\r\n}\r\n<\/pre>\n<p>Done. So have loaded the catalogs object with the xml data.<br \/>\nPoints to be noted from the above solution:<\/p>\n<ol style=\"text-align: left\">\n<li>object-create-rule creates an object<\/li>\n<li>Rest of the rules are straightforward as their name suggests, object-create-rule creates a new instance,                       set-properties-rule sets the properties of the object from xml attributes like  name attribute of catalog element whereas                       bean-property-setter-rule sets properties of the object from nested xml elements like say                       &lt;catalog&gt;&lt;name&gt;reparam&lt;\/name&gt; &lt;\/catalog&gt; instead of                       &lt;catalog name=&#8217;reparam&#8217;&gt; &lt;\/catalog&gt;<\/li>\n<li>&#8211;                       <strong>set-next-rule:<\/strong> (used for recursion) The set-next-rulerule moves to the next catalog, chain, and command tags. You have also specified the method to call in each case which will add the objects to a collection defined in the parent class, example : &lt;set-next-rule methodname=&#8217;addCommands&#8217;  paramtype=&#8217;Command&#8217;\/&gt;,                       here addCommands() method adds a command object to commands collection object defined in parent chain class.<\/li>\n<li>You want new custom rules,create your own Rule class deriving from digester Rule class.<\/li>\n<\/ol>\n<p>Any question, put your comments.                      <\/p>\n<p>One more thought, you don&#8217;t want all these shit inbetween the xml files and java classes. Guess what, there is a trick to avoid that. But I don&#8217;t like this trick unless you are in hurry. But everytime you use shortcut, you have to lose flexibilities.                       <\/p>\n<p>Trick is to use Apache Betwixt. Remember to use Betwixt, you need to use apache digester 2.1. For more go to apache Betwixt site.                       <\/p>\n<p>Use Betwixt BeanWriter to write the java beans to a file and then,  use BeanReader to read from that file. Once you get the file generated from BeanWriter, you can change the values abd load it with BeanReader. (Need to configure betwixt mapping omitted here)                      <\/p>\n<p>Happy coding and don&#8217;t forget to share!<\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/flawprogrammerdeo.blogspot.gr\/2012\/09\/using-apache-digester-with-example-make.html\">Using Apache Digester with Example -Make Easy Configuration<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Bijay Deo at the <a href=\"http:\/\/flawprogrammerdeo.blogspot.gr\/\">My Software Development Blog <\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Address Problem &#8211; Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just by changing the file.&nbsp;Apache Digester can do it for you easily. Transforming an XML document into a corresponding hierarchy of Java bean objects is a fairly easy using Apache Digester. See Digester &hellip;<\/p>\n","protected":false},"author":282,"featured_media":59,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[631],"class_list":["post-1838","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-digester"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache Digester Example - Make Easy Configuration - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Address Problem - Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Digester Example - Make Easy Configuration - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Address Problem - Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-09-12T01:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T06:55:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-digester-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bijay Deo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bijay Deo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html\"},\"author\":{\"name\":\"Bijay Deo\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7a4aedea8d4884a3f365b8020e5a53d8\"},\"headline\":\"Apache Digester Example &#8211; Make Easy Configuration\",\"datePublished\":\"2012-09-12T01:00:00+00:00\",\"dateModified\":\"2012-10-22T06:55:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html\"},\"wordCount\":594,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-digester-logo.jpg\",\"keywords\":[\"Apache Digester\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html\",\"name\":\"Apache Digester Example - Make Easy Configuration - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-digester-logo.jpg\",\"datePublished\":\"2012-09-12T01:00:00+00:00\",\"dateModified\":\"2012-10-22T06:55:43+00:00\",\"description\":\"Address Problem - Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-digester-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-digester-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/apache-digester-example-make-easy.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Apache Digester Example &#8211; Make Easy Configuration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7a4aedea8d4884a3f365b8020e5a53d8\",\"name\":\"Bijay Deo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a575147561f7ad9ccc8bcb597a6f97534f426c6b01e2fc6a3dc2fee3e7eca4cd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a575147561f7ad9ccc8bcb597a6f97534f426c6b01e2fc6a3dc2fee3e7eca4cd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a575147561f7ad9ccc8bcb597a6f97534f426c6b01e2fc6a3dc2fee3e7eca4cd?s=96&d=mm&r=g\",\"caption\":\"Bijay Deo\"},\"sameAs\":[\"http:\\\/\\\/flawprogrammerdeo.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Bijay-Deo\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Digester Example - Make Easy Configuration - Java Code Geeks","description":"Address Problem - Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html","og_locale":"en_US","og_type":"article","og_title":"Apache Digester Example - Make Easy Configuration - Java Code Geeks","og_description":"Address Problem - Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just","og_url":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-09-12T01:00:00+00:00","article_modified_time":"2012-10-22T06:55:43+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-digester-logo.jpg","type":"image\/jpeg"}],"author":"Bijay Deo","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Bijay Deo","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html"},"author":{"name":"Bijay Deo","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7a4aedea8d4884a3f365b8020e5a53d8"},"headline":"Apache Digester Example &#8211; Make Easy Configuration","datePublished":"2012-09-12T01:00:00+00:00","dateModified":"2012-10-22T06:55:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html"},"wordCount":594,"commentCount":5,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-digester-logo.jpg","keywords":["Apache Digester"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html","url":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html","name":"Apache Digester Example - Make Easy Configuration - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-digester-logo.jpg","datePublished":"2012-09-12T01:00:00+00:00","dateModified":"2012-10-22T06:55:43+00:00","description":"Address Problem - Hard Coding , Need to create custom configuration for your application like struts configuration file to vary application behavior just","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-digester-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-digester-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/apache-digester-example-make-easy.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Apache Digester Example &#8211; Make Easy Configuration"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7a4aedea8d4884a3f365b8020e5a53d8","name":"Bijay Deo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a575147561f7ad9ccc8bcb597a6f97534f426c6b01e2fc6a3dc2fee3e7eca4cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a575147561f7ad9ccc8bcb597a6f97534f426c6b01e2fc6a3dc2fee3e7eca4cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a575147561f7ad9ccc8bcb597a6f97534f426c6b01e2fc6a3dc2fee3e7eca4cd?s=96&d=mm&r=g","caption":"Bijay Deo"},"sameAs":["http:\/\/flawprogrammerdeo.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Bijay-Deo"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/282"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1838"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1838\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/59"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}