rest service with intellij - stony brook universitycse336/slides/rest service with intellij.pdf ·...

14
Rest Service with Intellij

Upload: others

Post on 26-Dec-2019

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Rest Service with Intellij

Page 2: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Overview

● Download IntellIj and run as Administrator● Setup Server● Create Project● Create Artifact● Check Artifact to server● Add Java Code● Compile

Page 3: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Add ServerDownload Glass Fish Server if your IntellIj is not providing oneGo to File → Settings -> Application server.

Page 4: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Create ProjectGo to File - > Project -> Java EE.

Select RestFul WebService and Web Application

Choose Glassfish server

Download any libraries if it is suggesting

Page 5: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks
Page 6: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks
Page 7: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

● Click next and give a Project Name● Make sure that your project structure is looks

same as in the next slide. Create the files in src folder

Page 8: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks
Page 9: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Create Artifact ( ctrl+ shift+ alt+ S)

Page 10: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Add the following helloworld Code in src

Page 11: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Add the following MyApplication Code in src

Page 12: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Server Configuration

● Go to Edit Configuration in GlassFish 4.1.1 Drop down(at the top)● Make sure that the URL contains the correct war name provided in the

previous step● Add the end point mentioned in helloword.java

Page 13: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Page 14: Rest Service with Intellij - Stony Brook Universitycse336/Slides/Rest Service with Intellij.pdf · Click next and give a Project Name Make sure that your project structure is looks

Start the server