I had a similar problem when I started using ValidatorForms. I customized the template struts_config_xml.xdt to get it to do the generation for ValidatorForms.


<!-- ========== Form Bean Definitions =================================== -->
<form-beans>
<XDtClass:forAllClasses type="org.apache.struts.validator.ValidatorForm">
<XDtClass:forAllClassTags tagName="struts:form" superclasses="false">
<form-bean
name="<XDtClass:classTagValue tagName="struts:form" paramName="name"/>"
type="<XDtClass:fullClassName/>"
/>
</XDtClass:forAllClassTags>
</XDtClass:forAllClasses>


Further down in the template (line 57), I expect if you change the type to org.apache.struts.actions.DispatchAction it will generate the actions for you.

<XDtClass:forAllClasses type="org.apache.struts.action.Action">

I then refer to the custom template from the ANT task rather than hacking the original.

I'm new to xDoclet, though, so I'm open to suggestions if there's a better practice than this.

-Ben

Norbert Spemm wrote:

I'm not sure if I'm missing something, but I receive the same error when
I extend from DispatchAction or LookupDispatchAction class


_AND_

unfortunately the action-mapping for that class is not generated by
xdoclet. When extending "Action" instead of "DispatchAction" everything
works fine.

 /*
  * @struts:action name="testForm" path="/test" scope="request"
  */

public final class ActionTest extends DispatchAction {

public ActionForward testAction1(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
// [...]
}
}


If this doesn't work and I have to manually create strutsconfig.xml I
can also remove xdoclet from my project since there's not much left it
generates for me. :(

Is there a way out?

Thanks for help




From: Erik Hatcher
Subject: Re: [Xdoclet-user] Building web.xml using 1.2 Beta 2 Date: Thu, 17 Oct 2002 08:58:47 -0700



This is a known "issue" because Struts has some static
initializers that get called during XDoclet's introspection of the class hierarchy and calling Class.forName(). I just live with it for now, because struts.jar is needed in my classpath for struts-config.xml generation.


Erik


Matt Raible wrote:


I am getting the following error when running the
<deploymentdescriptor>
task:

<deploymentdescriptor servletspec="2.3"
destdir="${build.stage_web}/WEB-INF"
sessiontimeout="1200">
</deploymentdescriptor>

[webdoclet] Running <deploymentdescriptor/>
[webdoclet] Generating web.xml.
[webdoclet] (util.MessageResourcesFactory 174 )
MessageResourcesFactory.createFactory
[webdoclet] java.lang.ClassNotFoundException: org.apache.struts.util.PropertyMessageResourcesFactory
[webdoclet] at
java.net.URLClassLoader$1.run(URLClassLoader.java:198)
This doesn't seem to happen when struts.jar is NOT in the classpath. This error does not seem to affect building web.xml.







------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user







-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to