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

Zero Configuration is too limited - cannot eliminate struts.xml

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.11
    • 2.1.8
    • "New" API
    • None
    • Java 5; Vista; JBoss 4.0.5.GA

    Description

      Consider this struts.xml snippet:

      <action name="customerContract"
      class="customerContractAction">
      <result name="success" type="dispatcher">
      /jsp/s2/customerContract.jsp
      </result>
      </action>
      <action name="customerContractFilter"
      class="customerContractAction" method="filter">
      <result name="success" type="dispatcher">
      /jsp/s2/customerContract.jsp
      </result>
      </action>

      The zero configuration at this time only has @Result and @Results tags. This means that:

      • it is not possible to configure multiple actions that share the same action-class (or action-bean in Spring); 'customerContract' and 'customerContractFilter' both point to the same action class, only the 'method' parameter is different ==> Struts 2 should offer some annotations for this
      • there's no way to express (with an annotation) that the Action-object should be injected with Spring beans (in a specific Spring ApplicationContext). It would be nice that such a feature would also be added to the framework
        This way, we could (completely/partially) eliminate the struts.xml file, or, in other words, make Zero Configuration really practically useable (which, IMHO, is not the case now.

      Regards
      Christian

      Attachments

        Activity

          People

            Unassigned Unassigned
            cbonami Chris Bonami
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: