How to integrate struts in J2EE project

This topic contains 2 replies, has 2 voices, and was last updated by  liammullan 14 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #217730 Reply

    liammullan
    Member

    Hi,

    I have a newbe question regarding the use of stuts in a J2EE project.

    I have developed a small struts project as described in the tutorials, and have a nice struts-config.xml and a generated web.xml. It works fine.

    Now I want to add the capability of using ejb references to a simple accompanying EJB project. My question is how can I add the ejb-ref elements to the default struts web.xml? I would like to use XDoclet, but if I use the deploymentdescriptor Xdoclet subtask, it replaces the action servlet info in the default struts web.xml.

    This question would also apply to other changes I might want to make to web.xml, for example adding servlet mapping elements etc.

    any help appreciated,

    Liam

    ps I’m using eclipse 3.0.1, jboss 3.2.5, myeclipse 3.8.2

    #217817 Reply

    Scott Anderson
    Participant

    Liam,

    Great question. Unfortunately, I’m not an expert on using Struts with XDoclet and EJB generation, so I snooped around and found a tutorial on DevX that looks like it will be helpful to you. It’s available here:
    http://www.devx.com/Java/Article/21065/0/page/1

    It’s not based on MyEclipse, but it is Eclipse based so it should be similar to what you need. Can anyone else provide any insights?

    #217842 Reply

    liammullan
    Member

    Hi,

    thanks thanks for the pointer Scott. The article implies the solution of splitting the web.xml generated by MyEclipse-struts into a merge directory prior to running xdoclet tasks. This works well.

    I image I could use the ‘strutsconfigxml’ XDoclet subtask instead, but when I run it I get an error:

    BUILD FAILED: C:\eclipse3-0-1\eclipse\workspace\TrainingTest\xdoclet-build.xml:32: Can’t create a strutsconfigxml element under webdoclet. Make sure the jar file containing the corresponding subtask class is on the classpath specified in the <taskdef> that defined {2}.

    I’ve seen this error mentioned once or twice but never found a solution… I have the xdoclet jar on the build path for the project. Anyone have an idea?

    thanks,

    Liam

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: How to integrate struts in J2EE project

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