REST API Web Service based on Spring MVC / Security
This sample Java Web based project was developed for a research and test purposes, which shows:
- Spring MVC 3.0.5 based implementation of RESTful Web Service for GET, POST, PUT, DELETE methods
- Web service authentication based on Spring Security 3.0.5 (HTTP Basic Auth)
- A sample web service client (front end) based on Spring MVC 3.0.5. Web client uses Spring RestTemplate to talk with RESTful Web service, for passing authentication it uses Apache Commons HttpClient library
- Spring JDBC Template based Database access (PostgerSQL 9.0.2)
Web Application consists of 2 parts:
- The core service back-end on the base of REST style Web Service to represent access to products database
- The web based front-end for online store (nothing fancy, just shows categories and products sorted by price)
Configuration files:
- restservice-auth.properties file holds authentication parameters of the core RESTful Web Service
- webclient-auth.properties file holds authentication parameters of Web Client to access RESTful Web Service
- jdbc.properties file holds database access parameters
I used FireFox with REST Client plugin for testing GET, POST, PUT, DELETE methods of the Web Service
A sample web front-end looks like:
The project is developed using Netbeans IDE 6.7.1 (Ant based build) and tested on Sun JDK 1.0.6_22, Tomcat 6.0.18 / Jetty (jetty-distribution-7.2.2.v20101205) and PostgreSQL 9.0.2 database.
At the end one note, please. As this project was developed for a research and test purposes, so be informed that input validation and exception handling procedures are not implemented here. Also, the front page wishes about a good design ;)
Zip file attached below includes all sources and a script file to create database schema and tables.
Download Project Source (6.4MB)
2023 September (1)
2023 August (1)
2019 May (1)
2016 March (2)
2016 February (1)
2014 December (1)
2013 May (1)
2013 March (1)
2013 February (1)
2012 December (2)
2012 October (1)
2011 February (2)
2010 October (2)
2010 July (1)
2010 May (1)
2010 April (1)