Struts 2 merge tag is useful for merging the two lists into one object. This is very helpful when you have two different list of objects and then you need to merge them and use it in your JSP page. Merge tag has nested param element to take the multiple list objects in each line. …
Struts 2 Tutorials
Struts 2 Iterator Tag Example
Struts 2 iterator tag is useful for iterating a value which of type java.util.Collections or java.util.Iterator. This example demonstrates with a simple iteration block which is taking the users list and displaying the list of users in the list. 1. Create Data Bean Create a UserDetails.java bean to hold the user details. 2. Create Struts …
Struts 2 If, Else Tag Example
This tag is useful for executing the simple if or else condition by taking the values from a variable. It is very similar to the one used in every language. You can use single else block or the multiple else block by using the else if condition. Let’s see an example to show the use of …
Struts 2 Configuration Files Path
If you are a first time developer who start working on the Struts 2 application, you would have got the below exception and no clue how to fix this problem. This error is thrown because your struts 2 application not able to read your configuration file struts.xml. In any other frameworks we keep the configuration …
Struts 2 Exception Configuration
Struts 2 simplifies the way we handle the exceptions. In the earlier version of Struts application, handling exceptions needs lot of work. In Struts 2, You can configure the exception type in the configuration file for the each action mapping and redirect to the custom error page. Here I have modified our hello world example …
Struts 2 Features
Struts 2 is the advanced version of Struts framework. This new framework is re-invented the MVC framework by integrating to another framework known as Webwork. There are handful of new features introduced in the Struts 2 release. When the Struts 1.0 was released, Struts is considered as the most popular web frameworks used by the …
Beginners Guide for Struts 2 Custom Validators
Struts 2.0 allows the use of Custom validators through the @CustomValidator annotation. The @CustomValidator annotation takes two mandatory parameters, type and message also read: Struts 2 Tutorials Struts Interview Questions Struts and Spring Integration type: Refers to the “name” given to the validator in the validators.xml file. message: Message to be displayed when this validator …