facebook

XDoclet and Struts: Not working! [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #214923 Reply

    Chris Cogar
    Member

    My problem is similar, but not exactly the same as others that I’ve seen posted.

    I have used MyEclipse in Eclipse to create a Web Project and added Struts support. If I use the wizards to create Action/Form/JSP, the appropriate info is added to struts-config.xml and the appropriate tags are added to the Action and Form java source files that are created.

    My problem is that, no matter what I try, I cannot get the XDoclet task to run and regenerate the struts-config.xml file. I have gone into project properties dialog and gone to the MyEclipse-XDoclet section, added the Standard Web configuration and then added strutsconfigxml “task” to the webdoclet item. I then configured strutsconfigxml as follows:

    destDir=WebRoot/WEB-INF
    destinationFile=struts-config.xml
    mergeDir=merge

    I then clicked Apply and OK, right=clicked on the project and selected MyEclipse->Run XDoclet. struts-config.xml is not regenerated. I’m somewhat new to XDoclet and am wondering what/whether I’m missing something. Is there documentation on setting up the struts xdoclet support in Eclipse/MyEclipse? Is there a tutorial? Any help would be greatly appreciated.

    Thanks!

    Chris

    #214930 Reply

    Riyad Kalla
    Member

    Chris,
    We are looking into this… I am a bit confused how regenerating a struts-config.xml file is even possible without XDoclet tags marking up the Actions, Forms and JSP files that dictate relationships between the three, not to mention arbitrary global resources, plugins, message-resources, etc.

    My gut reaction to this is that “its not possible” but don’t know what the XDoclet team intended with the struts-config subtask http://xdoclet.sourceforge.net/xdoclet/ant/xdoclet/modules/apache/struts/StrutsConfigXmlSubTask.html

    We will get back to you, I could be completely wrong.

    #214931 Reply

    Greg
    Member

    Chris,

    I was able to recreate the struts-config.xml file using xdoclet by doing the following assuming a struts project with form and action classes.

    1) Create “Standard Web” configuration in MyEclipse-XDoclet properties
    2) Remove deploymentdescriptor subdoclet since we don’t want to regenerate web.xml
    3) Add “strutsconfigxml doclet
    4) Modify “Version” to 1.1 and make sure it is checked
    5) Modify “destDir” to WebRoot/WEB-INF and make sure it is checked.
    6) Then click OK and run xdoclet.

    Piggybacking off what Riyad said, the Struts Modeler is much better at creating and editing the struts-config.xml file than using xdoclet. And that is our perferred use case for maintaining the struts-config.xml file. However, you can use xdoclet as I showed above if you prefer.

    #214945 Reply

    Riyad Kalla
    Member

    As usual, Greg you amaze me. Nice job!

    #214988 Reply

    Chris Cogar
    Member

    Well, I must say I’m a little confused then. Seems to me that if the wizards create the xdoclet tags and there’s a task that purports to rebuild struts-config from those tags, what other purpose is there to generating the tags?

    Regardless, I have been playing with this functionality in a test project and was able to get it to work if I added a struts module. However, I then deleted the module and then added it back and at that point it’s broken again (can’t get xdoclet to rebuild struts-config).

    Ah well, guess I’ll just have to wait until this technology is a bit more mature and stable. But if anyone should figure out a way to have xdoclet produce struts-config.xml more reliably, please let me know…

    Chris

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: XDoclet and Struts: Not working! [Closed]

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