XDoclet struts-config.xml in Struts

By: Kamini Emailed: 1728 times Printed: 2329 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

XDoclet based management of struts-config.xml is a entirely different concept. In XDoclet approach, there is no struts-config.xml at all! In the XDoclet approach, there is no struts-config.xml at all! All the requisite information linked to the <form-bean> and <action> are specified in the Action and Form
classes using special XDoclet tags as follows:

* @struts.action name="custForm" path="/editCustomer"
* scope="request" validate="false"
* parameter="action" input="mainpage"
*
* @struts.action-forward name="showCustForm"
* path="/ShowCustomerForm.jsp"

The above tags generate the Struts action mapping as follows in the strutsconfig.xml at build time.

<action path="/editCustomer"
type="mybank.app1.ShowCustomerAction"
name="custForm"
scope="request"
input="mainpage"
unknown="false" validate="false">
<forward name="showCustForm"
path="/ShowCustomerForm.jsp"
redirect="false"/>
</action>

XDoclet is project on sourceforge that started off with auto-generating home interface, remote interface, ejb-jar.xml from special tags in the EJB implementation class. It was a good idea with EJBs since the EJB implementation class would drive everything else - home, remote and the ejbjar.
xml
.

With struts-config.xml, none of the individual classes drive the flow in entirety. Everything works always in relation to another. You always want to track what is going on, how various pieces interact together and how the flow works. You always want to see which action takes you where and get the whole big picture as you develop. Hence the struts-config.xml serves much like whiteboarding - visualizing whats going on in its entirety. Providing this information via piecemeal approach in different files using XDoclet tags defeats the purpose. Providing this information via piecemeal approach in different files using XDoclet tags defeats the purpose. Hence our advice is not to use the XDoclet approach for auto-generating struts-config.xml.


Struts Home | All Struts Tutorials | Latest Struts Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Kamini
Importing the Certificate Reply from the CA example using keytool in Java
The switch Statement example in Java
Joins example in SQL
ERRNO.H Header File in C
XDoclet struts-config.xml in Struts
Macro Substitution using #define in C
Using Checkbox & Radio Tags, html:select, html:options in Struts Forms
Do while Loops in C
Functions in C
Opening files for read and write in C++
Operator Precedence in C++
StringItem sample program in J2ME
AWT-based applications with a User Interface Window in Java
store() and load() example in Java
Stray or Dangling Pointers in C++

More Tutorials in Struts
Configuring JDBC DataSources in Struts
Struts Classes
FAQ: Why was reload removed from Struts (since 1.1)?
FAQ: Why are my checkboxes not being set from ON to OFF?
Using JavaScript to submit a form in Struts
How to prepopulate a form in Struts
Simple example of using the requiredif Validator rule in Struts
Chaining actions in Struts
When is the best time to validate input in Struts
What is a Plug-in and how to use Java plug-ins with Struts?
7 Best Practices of Struts
Origin and Architecture of Struts
ActionErrors and ActionError in Struts
Tutorial on Struts Configuration File - struts-config.xml in Struts - from the book: Struts Survival Guide. Basics to Best Practices
Handling multiple buttons in HTML Form in Struts

More Latest News
Most Viewed Articles (in Struts )
Tutorial on Struts Configuration File - struts-config.xml in Struts - from the book: Struts Survival Guide. Basics to Best Practices
What is Struts? Which Version of Struts to use?
Introduction to Struts Architecture
Installing and configuring Tomcat and Struts
Using JavaScript to submit a form in Struts
Configuring JDBC DataSources in Struts
Struts 1 vs Struts 2
ForwardAction in Struts
FAQ: Why are my checkboxes not being set from ON to OFF?
Downloading and installing Struts
MVC Architecture (Model 2 Architecture)
Using Multibox in Struts
Writing the first Struts application
Handling multiple buttons in HTML Form in Struts
What is a Plug-in and how to use Java plug-ins with Struts?
Most Emailed Articles (in Struts)
Guidelines for Struts Application Development
Simple example of using the requiredif Validator rule in Struts
What is Struts? Which Version of Struts to use?
WebWork 2 is now Apache Struts 2
Struts 1 vs Struts 2
MVC with configurable controller
Installing and configuring Tomcat and Struts
Tutorial on Struts Configuration File - struts-config.xml in Struts - from the book: Struts Survival Guide. Basics to Best Practices
DispatchAction in Struts
Struts-GUI and Struts Console
Origin and Architecture of Struts
Is Struts the most popular web application framework for Java?
What is a Model View Controller (MVC) Model?
History of Struts
Configuring JDBC DataSources in Struts