The following comment has been added to this issue:

     Author: René Zanner
    Created: Thu, 9 Jun 2005 6:49 AM
       Body:
Hi Greg,

since today there is a new parameter "action-path" for the 
@struts.action-forward tag. If you don't specify it, the behaviour is as it 
used to be (that is wrong in your special case).

But if you have such a special inheritance structure, you have to map a certain 
action-forward to a single action by setting this parameter to the "path" value 
of the corresponding @struts.action tag.

In your case you would have to specify the "action-path" only on the 
TestSuperAction: 

/**
 * @struts.action
 * path="/superPath"
 *
 * @struts.action-forward
 * action-path="/superPath"
 * name="superForward"
 * path="/superForward"
 *
 * @version $Revision$
 */
public class TestSuperAction extends Action {

} 

This way the forward "superForward" will only be added to the action element of 
the TestSuperAction.

Since this feature is only available on HEAD in CVS, you have to checkout a 
fresh copy and build it by yourself or take a nightly build.

Hope that helps,

René
---------------------------------------------------------------------
View this comment:
  
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-683?page=comments#action_16713

---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-683

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XDT-683
    Summary: inheritance breaks struts action forwards
       Type: Bug

     Status: Open
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: XDoclet
 Components: 
             Apache Module
   Versions:
             1.2 Beta 3

   Assignee: xdoclet-devel (Use for new issues)
   Reporter: Greg Merrill

    Created: Thu, 23 Oct 2003 8:50 AM
    Updated: Thu, 9 Jun 2005 6:49 AM

Description:
If I have a custom action TestSuperAction which is subclassed by another class 
TestSubAction, duplicate action/forward entries are produced for the subclass 
in struts-config.xml.

Here is sample code:

/**
 * @struts.action
 *    path="/superPath"
 *
 * @struts.action-forward
 *    name="superForward"
 *    path="/superForward"
 * 
 * @version $Revision$
 */
public class TestSuperAction extends Action {

}

/**
 * @struts.action
 *    path="/subPath"
 *
 * @struts.action-forward
 *    name="subForward"
 *    path="/subForward"
 * 
 * 
 * @version $Revision$
 */
public class TestSubAction extends TestSuperAction {

}

When I run XDoclet, I get these entries in struts-config.xml.

    <action
      path="/superPath"
      type="TestSuperAction"
      unknown="false"
      validate="true"
    >
      <forward
        name="superForward"
        path="/superForward"
        redirect="false"
      />
    </action>
    <action
      path="/subPath"
      type="TestSubAction"
      unknown="false"
      validate="true"
    >
      <forward
        name="subForward"
        path="/subForward"
        redirect="false"
      />
      <forward
        name="superForward"
        path="/superForward"
        redirect="false"
      />
    </action>
    <action
      path="/superPath"
      type="TestSubAction"
      unknown="false"
      validate="true"
    >
      <forward
        name="subForward"
        path="/subForward"
        redirect="false"
      />
      <forward
        name="superForward"
        path="/superForward"
        redirect="false"
      />
    </action>

The TestSuperAction mapping is correct.  But for TestSubAction, I was not 
expecting duplicate action entries with merged, duplicate forwards.  I was 
expecting to get something more like this:

    <action
      path="/subPath"
      type="com.transcendsys.platform.web.ccc.TestSubAction"
      unknown="false"
      validate="true"
    >
      <forward
        name="subForward"
        path="/subForward"
        redirect="false"
      />
    </action>



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r 
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to