Web application, which uses Maven, JPA and Spring. It comes with an embedded H2 database and the Maven Jetty plugin configured.
To start the application use command line specified below:
mvn jetty:run
To access it type in a browser http://localhost:8080/datapine-test-app.
There are few roles and test users which are initialized during the start of the application:
ROLE_ADMINcan see list of users, every user details, all items, add or remove items- admin@dp.com / admin
ROLE_USERcan see list of users, see own items and add new itemsROLE_GUESTcan see the welcome page only- guest@dp.com / guest
When a user is registered, create domain object as it is.
When an item is added, create domain object as well as an Acl entry for item domain.
When item object is requested via find* methods filter out non authorized items.
//item object must linked to user domain.(acl_sid table has User.id as sid)
- Implement the
UserDAOusing JPA. - Implement the
UserServiceusing theUserDAOand transactions. - Implement a RESTful
UserControllerto manage users. - Implement a simple user login dialog to login a user. Use
HttpSessionto store the user credentials to save time, Spring Security can also be used. - Use Spring AOP to log all login attempts via console output or log4j.
- Implement and secure via spring security
ItemDAOandItem.