[ 
https://issues.apache.org/struts/browse/WW-2506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Don Brown resolved WW-2506.
---------------------------

    Resolution: Fixed
      Assignee: Don Brown

Ok, what I did was add a new configuration option to the codebehind plugin, 
"struts.configuration.classpath.disableActionScanning", which allows you to 
disable its classpath scanning.  I also added the setting, 
"struts.configuration.rest.disableControllerScanning", to the REST Plugin.  The 
REST plugin now disables the scanning by the codebehind plugin, but of course, 
you can re-enable it by changing the codebehind setting above.  The docs are 
updated as well.

> ControllerClasspathPackageProvider causes duplicate package error
> -----------------------------------------------------------------
>
>                 Key: WW-2506
>                 URL: https://issues.apache.org/struts/browse/WW-2506
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - REST
>    Affects Versions: 2.1.0
>            Reporter: Jeromy Evans
>            Assignee: Don Brown
>
> If a REST Controller (aka action) implements Action or is annotated with 
> @Action, the CodeBehind PackageProvider and the REST PackageProvider both 
> attempt to create the parent package.  This results in a duplicate package 
> error while building the configuration:
> ...
> Caused by: The package name 'mypackage.actions.parent' at location null is 
> already been used by another package at location null
> The reason is that CodeBehind's ClasspathPackageProvider detects the action 
> and configures the parent package, and the ControllerClasspathPackageProvider 
> (re)detects the Controller and configures the parent package.
> As it exists, this will be a common error as uses may tend to extend 
> ActionSupport to access ValidationAwareSupport and TextProviderSupport within 
> a Controller.
> Possible resolutions:
>   - REST plugin does not configure Controllers that are also Actions; or
>   - REST plugin provides unique names for the parent packages it creates 
> (currently it uses the java package name)
> I prefer the latter but aren't sure of the implications.  The change would 
> also impact the CodeBehind.
> I believe this only affects 2.1.1+ due to the strict configuration.  It can 
> be replicated by changing the rest-showcase Controller to extend 
> ActionSupport rather than ValidationAwareSupport.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to