Struts 2
  1. Struts 2
  2. WW-2576

Possibility to reduce classpath scanning to a parent-package

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: Future
    • Component/s: Plugin - Convention
    • Labels:
      None

      Description

      Right now, there is a constant named "struts.convention.exclude.packages"
      I had to add "oracle.toplink.*" in order to get the plugin working.

      It would be nice to have the possibility to configure a top level package (my.project.** ) that will be scanned instead of excluding everything else.

      After looking at the source I came to the conclusion that the convention
      plugin is designed to exclude a whole bunch of packages from classpath
      scanning. For my feeling that is not the best way to go because you can never
      be sure what is on your classpath. Worst case the application stops working
      because the admin adds some jars to the classpath of the appserver, the ear
      is extended with some lib or whatever. In an enterprise environment this
      behaviour is IMHO a no-no.

      Anyway, I do understand that there are usecases where this approach is needed.

      To solve this, I thought about an option like "scanPath" that defaults
      to "*" (or "^(.)$")  In my case, I would set it to something
      like "com.project.*" or "^com\.myproject\.(.)$"

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        111d 12h 14m 1 Piero Sartini 25/Jul/08 02:02
        In Progress In Progress Open Open
        19s 1 Piero Sartini 25/Jul/08 02:03
        Open Open Resolved Resolved
        129d 19h 35m 1 musachy 01/Dec/08 20:39
        Resolved Resolved Closed Closed
        1427d 1h 28m 1 Lukasz Lenart 28/Oct/12 22:07
        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jeff Turner made changes -
        Project Import Mon Feb 01 01:17:42 UTC 2010 [ 1264987062082 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status (temporary) [ 49202 ] Struts - editable closed status [ 50067 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status [ 45043 ] Struts - editable closed status (temporary) [ 49202 ]
        musachy made changes -
        Fix Version/s 2.2.x [ 21892 ]
        Fix Version/s Future [ 21530 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        musachy added a comment -

        Merged into sandbox + some tests. Thanks for the patch

        Show
        musachy added a comment - Merged into sandbox + some tests. Thanks for the patch
        Piero Sartini made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        Piero Sartini made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Piero Sartini made changes -
        Attachment struts2-convention-packageLocatorBase.patch [ 13833 ]
        Piero Sartini made changes -
        Affects Version/s 2.1.3 [ 21864 ]
        Assignee Piero Sartini [ psartini ]
        Summary Explicit configuration of included action packages Possibility to reduce classpath scanning to a parent-package
        Description Right now, there is a constant named "struts.convention.exclude.packages"
        I had to add "oracle.toplink.*" in order to get the plugin working.

        It would be nice to have the possibility to configure a top level package (my.project.* ) that will be searched instead of excluding everything else.

        Right now, there is a constant named "struts.convention.exclude.packages"
        I had to add "oracle.toplink.*" in order to get the plugin working.

        It would be nice to have the possibility to configure a top level package (my.project.** ) that will be scanned instead of excluding everything else.

        After looking at the source I came to the conclusion that the convention
        plugin is designed to exclude a whole bunch of packages from classpath
        scanning. For my feeling that is not the best way to go because you can never
        be sure what is on your classpath. Worst case the application stops working
        because the admin adds some jars to the classpath of the appserver, the ear
        is extended with some lib or whatever. In an enterprise environment this
        behaviour is IMHO a no-no.

        Anyway, I do understand that there are usecases where this approach is needed.

        To solve this, I thought about an option like "scanPath" that defaults
        to "**" (or "^(.*)$")  In my case, I would set it to something
        like "com.project.**" or "^com\.myproject\.(.*)$"
        Hide
        Piero Sartini added a comment -

        better explanation and included post from mailing list

        Show
        Piero Sartini added a comment - better explanation and included post from mailing list
        Don Brown made changes -
        Field Original Value New Value
        Fix Version/s 2.2.x [ 21892 ]
        Piero Sartini created issue -

          People

          • Assignee:
            Piero Sartini
            Reporter:
            Piero Sartini
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development