facebook

Xdoclet and custom templates for Struts ActionForm and JSP

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #240714 Reply

    bodziak222
    Member

    Hello,

    I try to automate code generation for web application. I have already designed clssses for DTO objects. Now I’m tring to generete struts ActionForm and related JSP page base on that. I found good examples of using XDoclet perform this task. Here are the url’s:
    ActionForm generation base on template :http://www.jroller.com/page/happy/Home/20050228

    JSP page: http://www.ehatchersolutions.com/JavaDevWithAnt/struts.html#strutsgen
    Addtionaly here is complete project download: http://www.ehatchersolutions.com/downloads/JavaDevWithAnt-1.0.zip
    the most intresting part is in tools\strutsgen folder.

    Question: How to configure MyExclipse to run code generation when using XDoclet template files ? I want to be able run XDoclet JSP generator using popup menu Myeclipse\Run Xdoclet.

    You can assume that I follow MyEclipse Enterprise application (WEB+EJB) folder struture.
    Addtionaly normal java project with DTO classes were added to workspace. All 3 projects builds EAR archive. Java sources are in src.

    Detail questions:
    – What shoud I put insted of ant variables like ${build.dir}. Absolute path, path reltive to …
    – Where to put *.xtd files. Inside project folder, in separte project ?
    – The solution with tools\strutsgen uses class thet extends Xdoclet capabilities. Where I should put or install this class.
    Here is e.g. ant task that i want to transform to My Exclipse settings

    <xdoclet destdir="${build.dir}" 
              excludedtags="@version,@author"         
               force="${xdoclet.force}">   
    <fileset dir="${project.src.dir}"            
        includes="**/${form.name}.java"    />
    <template templateFile="src/FormKeys.xdt"
            ofType="org.apache.struts.validator.ValidatorForm" 
             acceptAbstractClasses="false"  
             prefixWithPackageStructure="false"              
            destinationFile="{0}.properties"    /> 
    </xdoclet>

    Regards
    Andrzej

    #240807

    Riyad Kalla
    Member

    Andrzej,
    I would suggest to write build file and run it as an ant script and not try and piggy back the MyEclipse XDoclet support. Additionally you can edit your project’s Builders under Project Properties, and add a new “Ant Build” as your builder and add your script there.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Xdoclet and custom templates for Struts ActionForm and JSP

You must be logged in to post in the forum log in