Print occurrence of integer in java

Solution: There will be many ways to solve this problem, but here we are giving two solutions to print occurrence of integer 1) Printing occurrence of integer using Collections.freequence() method 2) Printing occurrence of integer using HashMap



Reverse a string in java with or without using StringBuilder api

Solution:  In this program there are 3 solutions  1) Reverse string using StringBuilder API 2) Reverse string by reading from end of the string 3) Reverse string by using Recursion



Write a program to generate a random integer in a specified range




Struts Validator Example

In this tutorial we learn how Struts is using Validator framework. Generally in Struts1 we will write validate() method in form bean to validate the form data, some times it is bit difficult to manage our validation logic in validate method some times we might need to write duplicated code , to address these kind of  issue we have […]

Find the Missing Number in array

You are given a list of n-1 numbers and these numbers are in the range of 1 to n. There are no duplicates in list. One of the number is missing in the list. Write a program to find the missing number. Example:




DispathAction example in Struts1

In this tutorial we will see how DispathAction in Struts work. What is the need of DispathAction and when we will use this struts built-in action ? When ever we want to implement a set of related functions into a single action class. We don’t want to write separate action class for each function. By using Struts […]

ForwardAction Example in Struts

In my previous hello world program we see that action class is taking the responsibility to forward the request(i.e return ActionForward type object) . Instead of writing  our action class we can use the utility class i.e special Action given by struts famework. i.e org.apache.struts.actions.ForwardAction. Let us have a small example below. we didn’t write  any FormBean […]

Tags in Struts-config.xml

In this tutorial we will learn about struts-config.xml in Struts Frame work., i.e  what are the tags available in struts-config.xml and what is the importance of tags and their attributes and what is the order of tags. Every Struts application must have at least one struts-config.xml which is used to configure all the resources like our view […]

Struts Helloworld Example

In this tutorial we will learn how to create a simple hello world example in Struts1. Technologies used in this article : 1. Struts1.3 2. Maven 1.4 3. Eclipse 4.2 4. JDK 1.5 1. Create Maven Web project in Eclispe and add the Maven  dependencies like as as below Maven’s pom.xml file.

2. Configure the […]