[ 
http://jira.codehaus.org/browse/XDP-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157065#action_157065
 ] 

Konstantin Pribluda commented on XDP-237:
-----------------------------------------

Annotations will net heko you with xdoclet:

/**
 * @author ko5tik
 * @xwork.action package="edit" name="createBead"
 * @xwork.result type="redirect"  name="success" value="/edit/files/index.vm"
 * @xwork.result type="velocity" name="error" value="/edit/error.vm"
 * 
 */
@SuppressWarnings({"WeakerAccess"})
public class CreateBeadAction extends AbstractDirectoryManipulationAction {


And there is no point to use strutsconfigxml plugin for struts-2, as this 
plugin is for struts 1
Use xwork plugin ( it's xwork driving struts 2 ) 

> Not able to create struts.xml for struts2 framework using xdoclet-2 
> --------------------------------------------------------------------
>
>                 Key: XDP-237
>                 URL: http://jira.codehaus.org/browse/XDP-237
>             Project: XDoclet 2 Plugins
>          Issue Type: Test
>            Reporter: ravishankar
>            Assignee: Konstantin Pribluda
>
> Using xdoclet 1.2.3 we were able to generate the code for struts 1.x 
> framework like struts-config.xml using xdoclet.
> We want to create struts.xml file with all action mapping details from our 
> action classes but we are not able to do it.
> <project name="GlobalBuildProperties" basedir=".">
>       <property file="build.properties" />
>       <property name="output.location" value="${project.base}/dist" />
>         <property name="jdev.home" value="C:/JDeveloper" />
>         <property name="codegenerator" 
> value="${jdev.home}/jdev/mywork/CodeGenerator" />
>       
>       <!-- Runtime JAR locations for compilation -->
>       <property name="j2ee.runtime.location" 
> value="${jdev.home}/j2ee/home/lib" />
>       <property name="struts.runtime.location" 
> value="C:/JDeveloper/jdev/mywork/CodeGenerator/lib/Struts2_Library/Struts2_Library"
>  />
>       <property name="xdoclet.runtime.location" 
> value="C:/xdoclet2/xdoclet-plugins-dist-1.0.4-bin/xdoclet-plugins-dist-1.0.4/lib"
>  />
>       <taskdef name="xd" classname="org.xdoclet.ant.XDocletTask">
>               <classpath>
>                       <fileset dir="${xdoclet.runtime.location}">
>                               <include name="**/*.jar" />
>                       </fileset>
>                       <fileset dir="${j2ee.runtime.location}">
>                               <include name="**/*.jar" />
>                       </fileset>
>                       <fileset dir="${struts.runtime.location}">
>                               <include name="**/*.jar" />
>                       </fileset>
>               </classpath>
>       </taskdef>
> </project>
> ============
> <?xml version="1.0" encoding="UTF-8" ?>
> <project name="XDocletBuildDemo" basedir=".">
>  <import file="build-properties.xml"/>
>  <target name="run.xdoclet">
>   <xd>
>    <!-- defines the file handled by xdoclet2 -->
>    <fileset dir="${codegenerator}/CodeGenerator/src">
>     <include name="**/*.java"/>
>    </fileset>
>    <!-- defines the processing of a plugin -->
>    <component 
>               classname="org.xdoclet.plugin.struts.StrutsConfigXMLPlugin" 
>               destdir="${project.base}" validate="false" 
> filename="struts.xml"/>
>   <component  classname="org.xdoclet.plugin.xwork.XWorkXMLPlugin" 
>               destdir="${project.base}" package="com.infosys" 
> filename="struts.xml" extends="webwork-default"
>               />              
>   </xd>
>  </target>
> </project>
> But the file is not getting generated.
> created a simple action class
> import com.opensymphony.xwork2.ActionSupport;
> public class HelloAction extends ActionSupport
> {
>     private String message;
>     public String getMessage()
>     {
>         return message;
>     }
>     public void setMessage(String message)
>     {
>         this.message = message;
>     }
>     public String execute() throws Exception
>     {
>         setMessage("Hello! Welcome in the world of Struts2.");
>         
>         return SUCCESS;
>     }
> }
> Please give me a sample of how to create struts.xml file using xdoclet-2 
> plugins.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
xdoclet-plugins-interest mailing list
xdoclet-plugins-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest

Reply via email to