Programming Tutorials

Struts Tutorials

1. DispatchAction in Struts

By: Grenfel : 2023-05-04

Description: DispatchAction is another useful built-in Struts Action. However you cannot use it as is. You will have to extend it to provide your own implementation. An example will make things clear. Consider an online credit card application. Customers fill the credit card application online. The bank personnel get a List screen as shown in Figure below and they can act in one of four ways - Approve, Reject or Add Comment. Consequently there are three images each being a .


2. Handling Duplicate Form Submissions in Struts

By: Ivan Lim : 2023-05-04

Description: Duplicate form submissions are acceptable in some cases. Such scenarios are called idempotent transitions. When multiple submissions of data are not critical enough to impact the behavior of the application, duplicate form submissions do not pose a threat.


3. Guidelines for Struts Application Development

By: Jagan : 2023-05-01

Description: Struts application development in enterprise applications requires discipline. We are not referring to any particular methodology; just some guidelines for Struts based application development for enterprise applications. In this section a stepby-step approach for Struts application development cycle is provided.


4. Configuring JDBC DataSources in Struts

By: Barbara : 2008-12-10

Description: You can define any number of JDBC javax.sql.DataSource objects for the application in the configuration file under the element . Every data source is defined within the element using the element. The element defines a number of attributes, the most important of which are listed in Table below.


5. Struts Classes

By: Barbara : 2008-12-09

Description: As you'd expect in an MVC framework, every request starts at the Struts controller, the heart of which is the ActionServlet class. This servlet is usually mapped to the extension *.do. For example, a request for /process.do would end up with the ActionServlet and tell it that the user has submitted a pizza order:


6. When is the best time to validate input in Struts

By: Apache Foundation : 2008-09-20

Description: This is an excellent question. Let's step back a second and think about a typical mid to large size application. If we start from the back end and work toward the view we have:


7. Chaining actions in Struts

By: Apache Foundation : 2008-09-20

Description: Chaining actions can be done by simply using the proper mapping in your forward entries in the struts-config.xml file. Assume you had the following two classes:


8. Simple example of using the requiredif Validator rule in Struts

By: Apache Foundation : 2008-09-20

Description: First off, there's an even newer Validator rule called validwhen, which is almost certainly what you want to use, since it is much easier and more powerful. It will be available in the first release after 1.1 ships. The example shown below could be coded with validwhen as:


9. How to prepopulate a form in Struts

By: Apache Foundation : 2008-09-20

Description: The simplest way to prepopulate a form is to have an Action whose sole purpose is to populate an ActionForm and forward to the servlet or JSP to render that form back to the client. A separate Action would then be use to process the submitted form fields, by declaring an instance of the same form bean name.


10. Using JavaScript to submit a form in Struts

By: Apache Foundation : 2008-09-20

Description: This is just one of many ways to achieve submitting a form and decoding the intended action. Once you get used to the framework you will find other ways that make more sense for your coding style and requirements. Just remember this example is completely non-functional without JavaScript.