Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3787

allow include other config files from classpath

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.8, 2.3.1.2
    • Fix Version/s: 2.5.10
    • Component/s: XML Configuration
    • Labels:
      None

      Description

      My struts.xml has something like this:

      <include file="struts/*.xml" />

      which works fine when the war is exploded and the files are under WEB-INF\classes

      but I build the application (war) with maven2 and I do package classes in a jar file.

      When Tomcat starts (tried with Tomcat 5 and Tomcat 7) only the main struts.xml (which is inside the jar) is loaded but not the ones inside struts/*.xml

      Am I doing something wrong? I looked for other options like <include file="classpath:..." /> but doesnt work

      Documentation says you can split the file and put into other jars but only with the name struts.xml. I do need multple files in a jar.

      Please advise.

        Issue Links

          Activity

          Hide
          lukaszlenart Lukasz Lenart added a comment -

          Did you try to use just <include file="*.xml"/> ?

          Show
          lukaszlenart Lukasz Lenart added a comment - Did you try to use just <include file="*.xml"/> ?
          Hide
          juan.alvarez Juan Alvarez G added a comment -

          The problem is that I have a lot of xml files which are not struts files (such as spring), so I put all struts files inside a "struts" folder (also for separation)

          Show
          juan.alvarez Juan Alvarez G added a comment - The problem is that I have a lot of xml files which are not struts files (such as spring), so I put all struts files inside a "struts" folder (also for separation)
          Hide
          newton_dave Dave Newton added a comment -

          Are the files at the root level, or actually in a package called struts?

          Show
          newton_dave Dave Newton added a comment - Are the files at the root level, or actually in a package called struts ?
          Hide
          juan.alvarez Juan Alvarez G added a comment -

          Thanks for writing!

          They are inside a package called struts

          Show
          juan.alvarez Juan Alvarez G added a comment - Thanks for writing! They are inside a package called struts
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 98979423a164e264d1291ac34dc9a16759173aea in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=9897942 ]

          WW-3787 WW-3961 Allows include config files from JARs

          Show
          jira-bot ASF subversion and git services added a comment - Commit 98979423a164e264d1291ac34dc9a16759173aea in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=9897942 ] WW-3787 WW-3961 Allows include config files from JARs
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Struts-JDK7-master #576 (See https://builds.apache.org/job/Struts-JDK7-master/576/)
          WW-3787 WW-3961 Allows include config files from JARs (lukaszlenart: rev 98979423a164e264d1291ac34dc9a16759173aea)

          • (edit) core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-include.xml
          • (edit) core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderWildCardIncludeTest.java
          • (edit) core/src/main/java/com/opensymphony/xwork2/util/ClassPathFinder.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #576 (See https://builds.apache.org/job/Struts-JDK7-master/576/ ) WW-3787 WW-3961 Allows include config files from JARs (lukaszlenart: rev 98979423a164e264d1291ac34dc9a16759173aea) (edit) core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-include.xml (edit) core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderWildCardIncludeTest.java (edit) core/src/main/java/com/opensymphony/xwork2/util/ClassPathFinder.java

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              juan.alvarez Juan Alvarez G
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development