Hi all,

I am using the struts-plugin to integrate spring and struts.

The default value of "@struts.action" - "type" attribute is its class name
and is able to overwrite. But currently, it's not overwritten in the result
struts-config.xml.

I attached a patch for "plugin/struts/strutsconfigxml/ActionMappings.jelly"
to reflect the "type" in the result struts config.

Thanks,

- Tadaya


--
#--------------------
# Tadaya Tsuyukubo
#   [EMAIL PROTECTED]
#--------------------

Index: ActionMappings.jelly
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-struts/src/main/java/org/xdoclet/plugin/struts/strutsconfigxml/ActionMappings.jelly,v
retrieving revision 1.4
diff -u -r1.4 ActionMappings.jelly
--- ActionMappings.jelly        10 Aug 2005 15:21:11 -0000      1.4
+++ ActionMappings.jelly        27 Jan 2006 17:39:53 -0000
@@ -1,40 +1,50 @@
-<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:jsl="jelly:jsl">
-       <action-mappings type="${plugin.getMappingtype()}">
-               <j:forEach var="actionClass" 
items="${plugin.getActionClasses()}">
-                       <j:set var="classTags" 
value="${actionClass.getTags()}"/>
-                       <j:forEach var="classTag" items="${classTags}">
-                               <j:if test="${classTag.name == 
'struts.action'}">
-                                       <j:set var="actionTag" 
value="${classTag}"/>
-                                       <action name="${actionTag.name_}" 
type="${actionClass.getFullyQualifiedName()}" path="${actionTag.path}" 
scope="${actionTag.scope}" input="${actionTag.input}"
-                                               roles="${actionTag.roles}" 
validate="${actionTag.validate}" parameter="${actionTag.parameter}" 
unknown="${actionTag.unknown}">
-                                               <j:set 
var="isItOnTheActionContext" value="false"/>
-                                               <j:forEach var="classTag" 
items="${classTags}">
-                                                       <j:if 
test="${classTag.name == 'struts.action'}">
-                                                               <j:set 
var="isItOnTheActionContext" value="${classTag.name_ == actionTag.name_}"/>
-                                                       </j:if>
-                                                       <j:if 
test="${isItOnTheActionContext}">
-                                                               <j:import 
uri="org/xdoclet/plugin/struts/strutsconfigxml/ActionForward.jelly" 
inherit="true"/>
-                                                               <j:import 
uri="org/xdoclet/plugin/struts/strutsconfigxml/ActionSetProperty.jelly" 
inherit="true"/>
-                                                               <j:if 
test="${classTag.name == 'struts.action-exception'}">
-                                                                       <j:set 
var="exceptionTag" value="${classTag}"/>
-                                                                       
<exception key="${exceptionTag.key}" type="${exceptionTag.type}" 
className="${exceptionTag.className}" handler="${exceptionTag.handler}" 
path="${exceptionTag.path}" scope="${exceptionTag.scope}"/>
-                                                               </j:if>
-                                                       </j:if>
-                                               </j:forEach>
-                                       </action>
-                               </j:if>
-                       </j:forEach>
-               </j:forEach>
-               <!-- actions merge contents... -->
-               <j:if 
test="${plugin.getMergeFile('struts-actions.xml').exists()}">
-                       <x:parse var="actions" 
xml="${plugin.getMergeFile('struts-actions.xml')}"/>
-               </j:if>
-               <jsl:stylesheet select="$actions">
-                       <jsl:template match="*" trim="false">
-                               <jsl:copy>
-                                       <jsl:applyTemplates/>
-                               </jsl:copy>
-                       </jsl:template>
-               </jsl:stylesheet>
-       </action-mappings>
-</j:jelly>
+<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:jsl="jelly:jsl">
+       <action-mappings type="${plugin.getMappingtype()}">
+               <j:forEach var="actionClass" 
items="${plugin.getActionClasses()}">
+                       <j:set var="classTags" 
value="${actionClass.getTags()}"/>
+                       <j:forEach var="classTag" items="${classTags}">
+                               <j:if test="${classTag.name == 
'struts.action'}">
+                                       <j:set var="actionTag" 
value="${classTag}"/>
+
+                                       <j:choose>
+                                               <j:when test="${empty 
actionTag.type}">
+                                                       <j:set var="actionType" 
value="${actionClass.getFullyQualifiedName()}" />
+                                               </j:when>
+                                               <j:otherwise>
+                                                       <j:set var="actionType" 
value="${actionTag.type}" />
+                                               </j:otherwise>
+                                       </j:choose>
+                                       <action name="${actionTag.name_}" 
type="${actionType}" path="${actionTag.path}" scope="${actionTag.scope}" 
input="${actionTag.input}"
+                                               roles="${actionTag.roles}" 
validate="${actionTag.validate}" parameter="${actionTag.parameter}" 
unknown="${actionTag.unknown}">
+
+                                               <j:set 
var="isItOnTheActionContext" value="false"/>
+                                               <j:forEach var="classTag" 
items="${classTags}">
+                                                       <j:if 
test="${classTag.name == 'struts.action'}">
+                                                               <j:set 
var="isItOnTheActionContext" value="${classTag.name_ == actionTag.name_}"/>
+                                                       </j:if>
+                                                       <j:if 
test="${isItOnTheActionContext}">
+                                                               <j:import 
uri="org/xdoclet/plugin/struts/strutsconfigxml/ActionForward.jelly" 
inherit="true"/>
+                                                               <j:import 
uri="org/xdoclet/plugin/struts/strutsconfigxml/ActionSetProperty.jelly" 
inherit="true"/>
+                                                               <j:if 
test="${classTag.name == 'struts.action-exception'}">
+                                                                       <j:set 
var="exceptionTag" value="${classTag}"/>
+                                                                       
<exception key="${exceptionTag.key}" type="${exceptionTag.type}" 
className="${exceptionTag.className}" handler="${exceptionTag.handler}" 
path="${exceptionTag.path}" scope="${exceptionTag.scope}"/>
+                                                               </j:if>
+                                                       </j:if>
+                                               </j:forEach>
+                                       </action>
+                               </j:if>
+                       </j:forEach>
+               </j:forEach>
+               <!-- actions merge contents... -->
+               <j:if 
test="${plugin.getMergeFile('struts-actions.xml').exists()}">
+                       <x:parse var="actions" 
xml="${plugin.getMergeFile('struts-actions.xml')}"/>
+               </j:if>
+               <jsl:stylesheet select="$actions">
+                       <jsl:template match="*" trim="false">
+                               <jsl:copy>
+                                       <jsl:applyTemplates/>
+                               </jsl:copy>
+                       </jsl:template>
+               </jsl:stylesheet>
+       </action-mappings>
+</j:jelly>

Reply via email to