You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Eric D. Nielsen (JIRA)" <ji...@apache.org> on 2007/09/25 16:50:36 UTC

[jira] Created: (WW-2205) Easier linkage of auto-Detected actions to custom XWork packages

Easier linkage of auto-Detected actions to custom XWork packages
----------------------------------------------------------------

                 Key: WW-2205
                 URL: https://issues.apache.org/struts/browse/WW-2205
             Project: Struts 2
          Issue Type: Improvement
          Components: Configuration
    Affects Versions: 2.0.9
            Reporter: Eric D. Nielsen
            Priority: Minor


There doesn't seem to be a good way to DRYly link all actions auto-detected by actionPackages to a arbitrary XWork package configured in struts.xml.

Using an explicit @ParentPackage addresses this, but having to repeat this annotation in every action isn't DRY.  Alternately forcing actions to extend some base class with said annotation isn't clean.

The documentation mentions that auto-Detected packages use a portion of the action's java package to set the namespace, but it doesn't mention anything about setting the action's package.  I've tried several permutations of java and xwork package names checking if I could get a match, but it doesn't seem like they connect  (it would be nice if config-browser listed the XWork package to help debug this)

A few possible solutions:
a) allow some sort of "default-package-ref" in struts the XML to state which package auto-detected actions would be placedin (of couse @ParentPackage would override)

b) allow an actionPackages setting at the package level rather than the application level, thus any actions detected in that java package would be assigned to the containing XWork package (still allowing the @ParentPackage override)

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


[jira] Commented: (WW-2205) Easier linkage of auto-Detected actions to custom XWork packages

Posted by "Brian Pontarelli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42285 ] 

Brian Pontarelli commented on WW-2205:
--------------------------------------

Perhaps the ParentPackage annotation should be a package level annotation as well. This would allow all actions within the same Java package to be placed into the same XWork package. Besides that, I can't think of a clean convention over configuration approach.

Also, SmartURLs and I think the current zero-config allow you to specify a property to set the default ParentPackage for everything that they setup. In SmartURLs the configuration setting is named:

    smarturls.action.default.parent.package

This influences the entire application. So, this along with the Java package annotation and the class annotation should cover most cases, unless I'm missing something.

> Easier linkage of auto-Detected actions to custom XWork packages
> ----------------------------------------------------------------
>
>                 Key: WW-2205
>                 URL: https://issues.apache.org/struts/browse/WW-2205
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 2.0.9
>            Reporter: Eric D. Nielsen
>            Priority: Minor
>             Fix For: Future
>
>
> There doesn't seem to be a good way to DRYly link all actions auto-detected by actionPackages to a arbitrary XWork package configured in struts.xml.
> Using an explicit @ParentPackage addresses this, but having to repeat this annotation in every action isn't DRY.  Alternately forcing actions to extend some base class with said annotation isn't clean.
> The documentation mentions that auto-Detected packages use a portion of the action's java package to set the namespace, but it doesn't mention anything about setting the action's package.  I've tried several permutations of java and xwork package names checking if I could get a match, but it doesn't seem like they connect  (it would be nice if config-browser listed the XWork package to help debug this)
> A few possible solutions:
> a) allow some sort of "default-package-ref" in struts the XML to state which package auto-detected actions would be placedin (of couse @ParentPackage would override)
> b) allow an actionPackages setting at the package level rather than the application level, thus any actions detected in that java package would be assigned to the containing XWork package (still allowing the @ParentPackage override)

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


[jira] Commented: (WW-2205) Easier linkage of auto-Detected actions to custom XWork packages

Posted by "Eric D. Nielsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42269 ] 

Eric D. Nielsen commented on WW-2205:
-------------------------------------

Oh I just noticed this is very similar to #2016.  If you want to copy/paste my description into that issue and close this out, fine by me.

I do think that the issue is not merely a documentation issue, however as the title/classification of #2016 indicates.  And I do feel that a comprehensive solution would have to entail

a) the current actionPackages implementation, supplmented with the default-package-ref mentioned in my initial report
b) allowing additional actionPackages to be configured within a package
c) some intelligent annotation based approach to this once/if packages can be defined in annotations in a useful manner

The reason I feel both a and b are needed is that for Zero Configuration to be useful we need to be able to easily inject out custom packages at the appropriate level -- (a) allows us to inject a global default which should account for majority of use cases.  (b) allows us to setup alternate defaults for entire action sets when needed without either repeating the @ParentPackage everywhere and without relying on the non-obvious (and possibly buggy?) "contamination" of other actions in the same java package via @ParentPackage as mentioned in #2016

> Easier linkage of auto-Detected actions to custom XWork packages
> ----------------------------------------------------------------
>
>                 Key: WW-2205
>                 URL: https://issues.apache.org/struts/browse/WW-2205
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 2.0.9
>            Reporter: Eric D. Nielsen
>            Priority: Minor
>             Fix For: Future
>
>
> There doesn't seem to be a good way to DRYly link all actions auto-detected by actionPackages to a arbitrary XWork package configured in struts.xml.
> Using an explicit @ParentPackage addresses this, but having to repeat this annotation in every action isn't DRY.  Alternately forcing actions to extend some base class with said annotation isn't clean.
> The documentation mentions that auto-Detected packages use a portion of the action's java package to set the namespace, but it doesn't mention anything about setting the action's package.  I've tried several permutations of java and xwork package names checking if I could get a match, but it doesn't seem like they connect  (it would be nice if config-browser listed the XWork package to help debug this)
> A few possible solutions:
> a) allow some sort of "default-package-ref" in struts the XML to state which package auto-detected actions would be placedin (of couse @ParentPackage would override)
> b) allow an actionPackages setting at the package level rather than the application level, thus any actions detected in that java package would be assigned to the containing XWork package (still allowing the @ParentPackage override)

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


[jira] Closed: (WW-2205) Easier linkage of auto-Detected actions to custom XWork packages

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher closed WW-2205.
-------------------------------

    Resolution: Won't Fix

CodeBehind is deprecated in favor of the Conventions plugin. I think Conventions has the abilities you are looking for. Reopen if this issue is still pertinent to you. Otherwise, check out Conventions and see if it has what you are looking for?

> Easier linkage of auto-Detected actions to custom XWork packages
> ----------------------------------------------------------------
>
>                 Key: WW-2205
>                 URL: https://issues.apache.org/struts/browse/WW-2205
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.0.9
>            Reporter: Eric D. Nielsen
>            Priority: Minor
>             Fix For: Future
>
>
> There doesn't seem to be a good way to DRYly link all actions auto-detected by actionPackages to a arbitrary XWork package configured in struts.xml.
> Using an explicit @ParentPackage addresses this, but having to repeat this annotation in every action isn't DRY.  Alternately forcing actions to extend some base class with said annotation isn't clean.
> The documentation mentions that auto-Detected packages use a portion of the action's java package to set the namespace, but it doesn't mention anything about setting the action's package.  I've tried several permutations of java and xwork package names checking if I could get a match, but it doesn't seem like they connect  (it would be nice if config-browser listed the XWork package to help debug this)
> A few possible solutions:
> a) allow some sort of "default-package-ref" in struts the XML to state which package auto-detected actions would be placedin (of couse @ParentPackage would override)
> b) allow an actionPackages setting at the package level rather than the application level, thus any actions detected in that java package would be assigned to the containing XWork package (still allowing the @ParentPackage override)

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


[jira] Updated: (WW-2205) Easier linkage of auto-Detected actions to custom XWork packages

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2205:
-----------------------------

    Fix Version/s: Future

> Easier linkage of auto-Detected actions to custom XWork packages
> ----------------------------------------------------------------
>
>                 Key: WW-2205
>                 URL: https://issues.apache.org/struts/browse/WW-2205
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 2.0.9
>            Reporter: Eric D. Nielsen
>            Priority: Minor
>             Fix For: Future
>
>
> There doesn't seem to be a good way to DRYly link all actions auto-detected by actionPackages to a arbitrary XWork package configured in struts.xml.
> Using an explicit @ParentPackage addresses this, but having to repeat this annotation in every action isn't DRY.  Alternately forcing actions to extend some base class with said annotation isn't clean.
> The documentation mentions that auto-Detected packages use a portion of the action's java package to set the namespace, but it doesn't mention anything about setting the action's package.  I've tried several permutations of java and xwork package names checking if I could get a match, but it doesn't seem like they connect  (it would be nice if config-browser listed the XWork package to help debug this)
> A few possible solutions:
> a) allow some sort of "default-package-ref" in struts the XML to state which package auto-detected actions would be placedin (of couse @ParentPackage would override)
> b) allow an actionPackages setting at the package level rather than the application level, thus any actions detected in that java package would be assigned to the containing XWork package (still allowing the @ParentPackage override)

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