Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cnapagoda/spring4-struts2-hibernate4

Spring4, Struts2 and Hibernate4 based sample web project
https://github.com/cnapagoda/spring4-struts2-hibernate4

Last synced: 9 days ago
JSON representation

Spring4, Struts2 and Hibernate4 based sample web project

Awesome Lists containing this project

README

        

# Spring4-Struts2-Hibernate4
Spring4, Struts2 and Hibernate4 based sample web project

In this sample project , I have integrated Structs2 and Spring 4 with Hibernate 4 using annotation based configuration. This project includes a simple CRUD java application, creating hibernate entities, saving data in MySQL database , performing database CRUD operations within transaction using annotation based configuration.

How to Run this project

- Create a database called `chandana`
- Compile the project using maven:
```sh
$ mvn clean install
```
- Run using jetty plugin
```sh
$ mvn jetty:run
```
- Access the `http://localhost:8080/Spring4/`

### Struts 2 - Interceptors

Struts2 Interceptors are responsible for most of the processing inside the Struts2 framework. You can register an interceptor in Action class level or make it default for all the actions.


@InterceptorRef(value="customStack")

or


### Struts 2 - different ways to create Action classes

- Implementing Action interface
- Using Struts2 @Action annotation
- Extending ActionSupport class(Ex: LoginAction - I used this option. There you can override methods validate and execute methods.)

### Structs2 - Validation support.

The Struts validation framework provides inbuilt validation support. In this sample I have implemented required string validation. So please refer LoginAction class.