jbas
asked on
how can i use xdoclet to create struts2's struts.xml?
hi,experts
i want use xdoclet to create struts2's config file like struts.xml,
how can i do it?
and i need what jar to do it?
Thanks!
i want use xdoclet to create struts2's config file like struts.xml,
how can i do it?
and i need what jar to do it?
Thanks!
ASKER
hi,pmartin8 experts,
thanks , i want write a script in my action java file,and use ant to build it's struts.xml,now i do not know what script i need to write in my action java,and in build.xml i need what code,and xdoclet is support struts2?
i want write the script in java action like thils:
/**
*
* @struts.package name="example" namespace="/example" extends="s20-default"
* @struts.action name="Login_*" method="{1}" class="example.Login"
* @struts.action-result name="startup"
* @struts.action-result name="input"
*
*/
but i not sure it can be work.
thanks , i want write a script in my action java file,and use ant to build it's struts.xml,now i do not know what script i need to write in my action java,and in build.xml i need what code,and xdoclet is support struts2?
i want write the script in java action like thils:
/**
*
* @struts.package name="example" namespace="/example" extends="s20-default"
* @struts.action name="Login_*" method="{1}" class="example.Login"
* @struts.action-result name="startup"
* @struts.action-result name="input"
*
*/
but i not sure it can be work.
hmmm well...
in the struts.xml there is much more than just action and result definitions...
Moreover, using the best practices you should split the configuration files in many packages and many files...
For example, if you have an admin view, you will have the struts.xml include the user-view-config.xml and the admin-view-config.xml
I harldy see how you could define such things with annotations.
If you generate the struts.xml with a doclet, then you will need to recompile all the code whenever you change a result foward.
I guess I don't understand your requirements, but to me even if it's possible, this is not a good idea to generate the struts.xml with a xdoclet script
in the struts.xml there is much more than just action and result definitions...
Moreover, using the best practices you should split the configuration files in many packages and many files...
For example, if you have an admin view, you will have the struts.xml include the user-view-config.xml and the admin-view-config.xml
I harldy see how you could define such things with annotations.
If you generate the struts.xml with a doclet, then you will need to recompile all the code whenever you change a result foward.
I guess I don't understand your requirements, but to me even if it's possible, this is not a good idea to generate the struts.xml with a xdoclet script
ASKER
hi,kmappers experts,
thanks for your reply,in struts1,i use xdoclet to create struts-config.xml,and i write some script in my action java file ,and when i use spring ,i write script in my spring's java file to create spring.xml,i do it because i can manage some xml config file in java source,and when i need to deplay it ,i use ant to build the build.xml file,it's so easy.
>>For example, if you have an admin view, you will have the struts.xml include the user-view-config.xml and the admin-view-config.xml
yes, if possible,i want to build the admin-view-config.xml,othe r-config.x ml..... with xdoclet,but now i not know to create single struts.xml .
struts1 script:
in my action:
/**
*
* @struts.action path="/common/commonAction " scope="request" name="callForm" parameter="doaction"
* @struts.action-forward name="userSearchCollectFor ward" path="/WEB-INF/webpages/ca ll/userCol lectFrame. jsp"
* @struts.action-forward name="userSearchForward" path="/WEB-INF/webpages/ca ll/userSea rch.jsp"
* @struts.action-forward name="userCollectForward" path="/WEB-INF/webpages/ca ll/userCol lect.jsp"
* @struts.action-forward name="dTreeForward" path="/WEB-INF/webpages/ca ll/dTree.j sp"
* @struts.action-forward name="dTreeServerForward" path="/WEB-INF/webpages/ca ll/dtreeSe rver.jsp"
* @struts.action-forward name="dptuserCollectForwar d" path="/WEB-INF/webpages/ca ll/dptuser Collect.js p"
* @struts.action-forward name="dptuserForward" path="/WEB-INF/webpages/ca ll/deptUse rTreeFrame .jsp"
* @struts.action-forward name="ldbzForward" path="/WEB-INF/webpages/ca ll/ldbzPag e.jsp"
*/
in springImpl java file i create spring.xml use this code.
/**
* @spring.proxy id="parameterService" parent="baseTransactionPro xy"
* @spring.bean
* @spring.property name="paramDao" ref="paramDao"
*/
thanks for your reply,in struts1,i use xdoclet to create struts-config.xml,and i write some script in my action java file ,and when i use spring ,i write script in my spring's java file to create spring.xml,i do it because i can manage some xml config file in java source,and when i need to deplay it ,i use ant to build the build.xml file,it's so easy.
>>For example, if you have an admin view, you will have the struts.xml include the user-view-config.xml and the admin-view-config.xml
yes, if possible,i want to build the admin-view-config.xml,othe
struts1 script:
in my action:
/**
*
* @struts.action path="/common/commonAction
* @struts.action-forward name="userSearchCollectFor
* @struts.action-forward name="userSearchForward" path="/WEB-INF/webpages/ca
* @struts.action-forward name="userCollectForward" path="/WEB-INF/webpages/ca
* @struts.action-forward name="dTreeForward" path="/WEB-INF/webpages/ca
* @struts.action-forward name="dTreeServerForward" path="/WEB-INF/webpages/ca
* @struts.action-forward name="dptuserCollectForwar
* @struts.action-forward name="dptuserForward" path="/WEB-INF/webpages/ca
* @struts.action-forward name="ldbzForward" path="/WEB-INF/webpages/ca
*/
in springImpl java file i create spring.xml use this code.
/**
* @spring.proxy id="parameterService" parent="baseTransactionPro
* @spring.bean
* @spring.property name="paramDao" ref="paramDao"
*/
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
hi,kmapper,
i don't know how to use xworktag,and how can i write the build.xml.
Best regard!
i don't know how to use xworktag,and how can i write the build.xml.
Best regard!
Well, I never used them neither...Sorry I don't have any example to provide...
How could it know the actions your are using in your application? how could it know where the result are going and stuff like that?
Do you want me to send an example of a struts.xml?