From: ravishankar (JIRA) <ji...@co...> - 2008-12-08 09:04:22
|
[ http://jira.codehaus.org/browse/XDP-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157220#action_157220 ] ravishankar commented on XDP-237: --------------------------------- I don't need *struts-config.xml* file which is for struts 1.x I need *Struts.xml* which is for struts 2. Can you let me know how to generate the above file using xdoclet 2? Are you able to generate the above file? > 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 |