Hello all, first, I'm a little frenchie with a bad english, I hope that
my mail will be understood by all of you

I'm actually using struts to develop a web application, I've just heard
about xdoclet and wanted to use it for managing my struts-config.xml
file, I like the idea of tiying an action configuration with some
xdoclet tags.

I've read the documentation of the strutsconfigxml tag and seen the
parameters of the struts doclet tag but I am wondering about two
parameters :

[name]: String  The name of the action. Must be unique within the bounds
of the Struts application.
[scope]: "request" | "session" | "application"  Define the scope of the
action. Defaults to request.

- I don't think that the [name] parameter represents the name of the
action in the struts-config file, but it appears that the name parameter
should represent the form-bean name that this action will use and
validate. The parameter that identify uniquely an action is the [path]
parameter.

- The parameter scope is not mandatory, it should exists if the action
use a form bean, it is possible for an action to have no form bean to
use, xdoclet always append a scope parameter if not declared in the
javadoc.

- Also in struts it is possible to declare any number of action tags
with the same implementation class and have different forwards for each
of these tags. I try but I can't have a walid result using xdoclet.
Imagine, I have an action 'MyAction' and I have in my struts-config
file:

<action path="/doThis"
        type="mypackage.MyAction"
>
        <forward name="success" path="/resultThis.jsp"/>
</action>
<action path="/doThat"
        type="mypackage.MyAction"
>
        <forward name="success" path="/resultThat.jsp"/>
</action>


=> in my javadoc I try to do this this way : 

/**
 * @struts:action   path="/doThis"
 *
 * @struts:action-forward  name="success"
 *                  path="/resultThis.jsp"
 *

 * @struts:action   path="/doThat"
 *
 * @struts:action-forward  name="success"
 *                  path="/resultThat.jsp"
 *
*/

but the result was : 

<action path="/doThis"
        type="mypackage.MyAction"
>
        <forward name="success" path="/resultThis.jsp"/>
        <forward name="success" path="/resultThat.jsp"/>
</action>
<action path="/doThat"
        type="mypackage.MyAction"
>
        <forward name="success" path="/resultThis.jsp"/>
        <forward name="success" path="/resultThat.jsp"/>
</action>

which I think is not correct, it seems that xdoclet binds all forwards
to all actions declared in the javadoc.

I hope I've not misenderstood the way to use xdoclet for struts-config
file generation and hope that I could use it in the proper way

--Kev





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Two, two, TWO treats in one.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to