Home » mvc

Tag Archives: mvc

Spring MVC ModelMap Example

In spring mvc, the org.springframework.ui.ModelMap object is used to pass the multiple values from the spring controller to the view. In this tutorial, we will show how to implement the org.springframework.ui.ModelMap object with the spring mvc framework. 1. Introduction 1.1 Spring Framework Spring is an open-source framework created to address the complexity of an enterprise application development One of the ...

Read More »

Struts 2 @ResultPath Annotation Example

Struts 2, the famous Model-View-Controller (MVC) framework, has several features that allows you to shape your webapp the way you want it. Among those features, a handy one is @ResultPath, which allows you to change the location where results are stored. The best way to explain how it works is through an example.         1. Setup a ...

Read More »

Struts 2 “HelloWorld” Example

Struts 2 is a famous Model-View-Controller (MVC) framework, mainly found in the enterprise market since its release in 2000. Its goal is to separate the model (the business logic) from the view (the HTML pages) and the controller (the instance that manages the interaction between the model and the view). Struts provides the controller class, while we are in charge ...

Read More »

Spring MVC Form Handling Example

With this tutorial we shall explain create and submit a form in Spring MVC. Spring MVC provides tags that are data binding-aware and allow us to handle form elements, compining JSP and Spring Web MVC. Each tag in Spring MVC provides support for the set of attributes of its corresponding HTML tag, thus making the tags familiar and intuitive to ...

Read More »

Spring MVC File Upload Example

With this tutorial we shall explain how to provide users the option to upload a file, inside a form in Spring MVC. When creating and submitting a form, it is very common need to upload a file during the form submission. This can be achieved very easily, with the use of Spring MVC API. This example contains a simple class, ...

Read More »

Spring MVC Form Errors Tag Example

In this example we will show you how to display error messages when submitting a form in Spring MVC. The tag provided by Spring MVC is errors tag. The errors tag renders field errors in an HTML span tag. It provides access to the errors that are created in the Controller or the Validators used. Here, we will create a ...

Read More »

Spring MVC Hidden Value Example

This is an example of how to make use of a hidden value in Spring MVC. Spring MVC provides tags that are very similar to HTML tags and can offer the same functionality. When creating a form, there is sometimes a need to keep a value in a view and use it in a next step, without making it visible ...

Read More »

Spring MVC Dropdown Box Example

With this example we shall show you how to create a dropdown box using Spring MVC. Spring MVC provides us with tags similar to HTML tags in functionality. In order to make use of a dropdown box, in Spring MVC, we are going to use the options tag. This tag renders a list of HTML option tags and sets the ...

Read More »

Spring MVC Radiobutton And Radiobuttons Example

This is a simple example of how to use the radiobutton and radiobuttons tags in Spring MVC. Among the most famous HTML tags is the radio button tag, that renders one or multiple HTML input tags with type radio. The radiobutton and radiobuttons tags are pretty similar to the HTML radio button tag and they are very easy to use, ...

Read More »

Spring MVC Checkbox And Checkboxes Example

This is a simple example of how to create a checkbox and a checkboxes tag in Spring MVC. Among the most famous HTML tags is the checkbox tag, that allows users to check one or more values in a form. Spring MVC checkbox and checkboxes tags are pretty similar to the HTML checkbox tag and they are very easy to ...

Read More »