Building restful services with Jersey 7--jersey+sqlserver+hibernate4.3+spring3.2

Source: Internet
Author: User

First, the overall description

This example performs a demonstration of building a RESTful service with Jersey. How to integrate Spring3

Second, the environment
    • 1. The above item Restdemo
    • 2.Spring and other related jars, importing the project
Third, the configuration

1. Create a Spring configuration file under the root folder applicationContext.xml ;
Configuration such as the following:

Iv. implementation

1. Execute the project first

2. Perform Userclient.java test, console output such as the following

Add User adduser******** query all getallusers****[{"userid": "002", "UserName": "SDFs", "Age": "},{", "userid": "003", " UserName ":" SDFs "," Age ":" All "},{" userid ":" 004 "," UserName ":" SDFs "," Age ":"},{"," userid ":" 005 "," UserName ":" SDFs "," Age ":"},{"userid": "006", "UserName": "Susan", "Age": "+"},{"userid": "007", "UserName": "SDFs", "Age": "23"},{" UserId ":" DS "," UserName ":" DS "," Age ":" DS "}]**** change user updateuser******** by ID query user ****006susan33**** query all getallusers** **[{"userid": "002", "UserName": "SDFs", "Age": "All"},{"userid": "003", "UserName": "SDFs", "Age": "All"},{"userid": "004" , "UserName": "SDFs", "Age": "},{", "userid": "005", "UserName": "SDFs", "Age": "},{", "userid": "006", "UserName": "Susan "," Age ":"},{"," userid ":" 007 "," UserName ":" SDFs "," Age ":" All "},{" userid ":" DS "," UserName ":" DS "," Age ":" DS "}]**** Delete User ******** query all getallusers****[{"userid": "002", "UserName": "SDFs", "Age": "},{", "userid": "003", "UserName": "SDFs "," Age ":"},{"," userid ":" 004 "," UserName ":" SDFs "," Age ":" All "},{" userid ":" 005 "," UserName ":" SDFs "," Age ":" 23 "},{" UserId ":" 007 "," UserName":" SDFs "," Age ":"},{"," UserId ":" DS "," UserName ":" DS "," Age ":" DS "}] 

This chapter source code (including Jar package): Https://github.com/waylau/RestDemo/tree/master/jersey-demo7-sqlserver-hibernate-spring3

Building restful services with Jersey 7--jersey+sqlserver+hibernate4.3+spring3.2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.