Java Jersey Framework Initial experience _java

Source: Internet
Author: User

I. Background

Recently, Jersey Learning group Friends More and more, many friends ask some very basic questions, I think this phenomenon is widespread, because the students into the group are mostly Jersey beginners, and, worse, may be Java beginners, they take on rest WebService curiosity, broke into the jersey of the framework of the learning field, however, because is a novice, feel the tiger eat days, can't claw! In order to guide beginners to learn, follow-up I will write a few about jersey Entry level blog, please everyone look forward to!

Second, preface

This article is mainly Jersey experience, you will not do any coding in the case, experience the jersey frame of the charm! This article also assumes that you have the MAVEN plugin installed in Eclipse!

Third, step

1. New MAVEN Project







2, select the project Maven prototype (Jersey-quickstart-grizzly), this is based on the 1.7 version of the jersey



3, fill in the project information, fill out the click "Finish"



4, in the Eclipse address bar at the lower right you can see that the project is being generated



5, after the build of the project structure as shown below, where Main.java is a Grizzly Web server launched Java applet,
MyResource is the automatic generation of the first rest resource class, which contains a simple GET request resource.



6. The execution of Main.java,grizzly Web server will start.



7, Access Http://localhost:9998/application.wadl, as shown in the following figure, this is the generated rest Resource Description Language



8, access to the generated test resources, as shown in the following figure, see "Got it", indicating that you have successfully experienced jersey's first Hello World program!



Summary:

1. Currently, most open source projects use Maven management, and being able to master Maven is critical to learning an Open-source project, otherwise you don't know how to start!

2, the use of Maven can automatically download the corresponding jar source code and Javadocs, which is an in-depth study of an open source project provides a convenient way, otherwise the binary jar, but also to find source code, not only waste time, and may find the source code on the version.

3, it is best to use the Eclipse Maven plug-in, some operations are visualized to execute, than the command line is much simpler, or to remember a lot of orders, but also very demanding, I have a deep experience! I hope we can get started as soon as possible, less detours.

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.