Java API | Developing Restful APIs | Rest API In Java | Java Tutorial | Java Training | Edureka

Поделиться
HTML-код
  • Опубликовано: 11 апр 2017
  • 🔥 Java Training (Use Code "𝐘𝐎𝐔𝐓𝐔𝐁𝐄𝟐𝟎"): www.edureka.co/java-j2ee-trai...
    This Edureka Java tutorial (Java Blog Series: goo.gl/12JH8n) will help you in understanding the concepts of API in Java. This video helps you to learn following topics:
    1:20 What is an API?
    3:44 API in Java
    6:53 Rest API
    9:16 Creating a Restful Web Service
    You can download Jersey files from the following link : goo.gl/Qie7ZN
    Check out our Java Playlist: goo.gl/ES3dI3
    Subscribe to our channel to get video updates. Hit the subscribe button above.
    #Java #Javatutorial #Javaonlinetraining #Javaforbeginners #Javacertification
    How it Works?
    1. This is a 7 Week Instructor led Online Course, 45 hours of assignment and 20 hours of project work
    2. We have a 24x7 One-on-One LIVE Technical Support to help you with any problems you might face or any clarifications you may require during the course.
    3. At the end of the training you will be working on a real time project for which we will provide you a Grade and a Verifiable Certificate!
    - - - - - - - - - - - - - - - - -
    About the Course
    Edureka's Advanced Java/J2EE and SOA training and certification course is designed for students and professionals who want to be a Java Developer. This is a 42 hour course which will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XML Handling etc. We will also learn various Java frameworks like Hibernate and Spring. During our Java/ Certification training, our instructors will help you:
    1. Develop the code with various Java data types, conditions and loops.
    2. Implement arrays, functions and string handling techniques.
    3. Understand object oriented programming through Java using Classes, Objects and various Java concepts like Abstract, Final etc.
    4. Implement multi-threading and exception handling.
    5. Use parse XML files using DOM and SAX in Java.
    6. Write a code in JDBC to communicate with Database.
    7. Develop web applications and JSP pages.
    8. Interact with the database using hibernate framework.
    9. Write code with spring framework components like Dependency Injection and Auto Wiring.
    10. Implement SOA using web services.
    - - - - - - - - - - - - - - - - - - -
    Who should go for this course?
    This course is designed for professionals aspiring to become Java Developers. Programmers, Web Developers, Web Designers, Programming Hobbyists, Database Administrators, Youngsters who want to kick start their career are the key beneficiaries of this course.
    - - - - - - - - - - - - - - - -
    Why learn Java?
    Java is a general-purpose, class-based, object-oriented computer programming language that was designed by James Gosling at Sun Microsystems in 1995.
    Key Highlights of Java:
    Platform Independent: This allows programmers to develop applications that can run on any operating system.
    Usability of Java: Java is most widely used programming language. It is present everywhere. It really doesn't matter which domain you are working in, you will surely come across Java sooner or later!
    Open Source: The good news is that Java is available for free! All the development tools and the environment (JRE & JDK) that is used to develop Java applications are absolutely free of cost.
    Android: Irrespective of the fact that you are tech savvy or not, most of us are badly bitten by the Android bug! Android is in great demand today and fortunately you need Java for Android development. Hence, the importance of Java has increased even more.
    Hadoop: Hadoop is one of the most trending framework for processing Big Data. It has been designed and developed in Java.
    In spite of having a tough competition on the server side from Microsoft and other companies, Java is doing extremely well on mobile platforms, thanks to Android! It has also been the primary language for Hadoop Developers.
    For Java Training and Certification, please write back to us at sales@edureka.co or call us at IND: 9606058406 / US: 18338555775 (toll free).
    Facebook: / edurekain
    Twitter: / edurekain
    LinkedIn: / edureka

Комментарии • 137

  • @edurekaIN
    @edurekaIN  6 лет назад +5

    Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Java Training Curriculum, Visit our Website: bit.ly/32Ymvde

  • @pavansrinivasvedantham9006
    @pavansrinivasvedantham9006 7 лет назад +3

    This is very nice and clear presentation.... thank you

  • @vladimirsuslov4134
    @vladimirsuslov4134 6 лет назад +5

    Thank you. Very educational

  • @pushkarajbhandari1836
    @pushkarajbhandari1836 6 лет назад +50

    Guys, if you follow same tutorial and copy web.xml same as said, you will most probably land up with error : Class not found exception.
    To avoid this, in your web.xml file, mentioned below value for parameter.
    Correct - org.glassfish.jersey.servlet.ServletContainer
    Wrong - org.glassfish.jersey.servlet.ServletContainer.class

    • @nickbarra5797
      @nickbarra5797 5 лет назад

      thank you ,,,you saved my time :)

    • @bongotsav7535
      @bongotsav7535 4 года назад

      thanks for the info, it helped!

    • @chandrakantaghadei4569
      @chandrakantaghadei4569 4 года назад

      Hi, I tried the both but still facing the same issue--------- java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer

    • @anayman7
      @anayman7 4 года назад +1

      happened to me today while following this tutorial, I did find it myself at the end and came to comment about it and found your comment

    • @jayanthananabaian206
      @jayanthananabaian206 4 года назад

      thanks man

  • @prashant09090
    @prashant09090 7 лет назад +3

    Very well explained..Great tutorial

  • @aidahailu2320
    @aidahailu2320 7 лет назад +2

    Great tutorial and easy to understand.

  • @fabricioandrescastilloalva5173
    @fabricioandrescastilloalva5173 4 года назад +12

    Thanks a lot man! We were having a mental breakdown, but your video saved us! You are our hero!!

  • @amankaur7438
    @amankaur7438 7 лет назад +2

    it is realy very helpful thanks

  • @diliplj3840
    @diliplj3840 7 лет назад +4

    IT IS GOOD VIDEO TO LEARN API

  • @oocanto
    @oocanto 2 года назад +4

    Muy bueno, aunque estaría bueno un ejemplo de CRUD.

  • @chilukotipranathi4791
    @chilukotipranathi4791 4 года назад +17

    The best Indian tutorial RUclips channel ever . I can understand every single thing very clearly that you teach👍🏻

  • @docktordicking2852
    @docktordicking2852 6 лет назад +1

    Very nice m8 thanks!

  • @Kumuthapoorvi
    @Kumuthapoorvi 5 лет назад +1

    thank you for nice class

  • @sergiyrudenko905
    @sergiyrudenko905 6 лет назад

    Thank you very much!

  • @js97989
    @js97989 2 года назад +1

    should we need this xml configurations when we use spring boot ? and create an maven prjct or anyother prjct .

  • @arsalanshaikh3763
    @arsalanshaikh3763 7 лет назад +6

    u r great edureka thank u for all of ur tutorials

    • @edurekaIN
      @edurekaIN  7 лет назад

      Hey Arsalan, thanks for the wonderful feedback! We're glad we could help.
      Do subscribe to our channel to stay posted on upcoming tutorials.
      You can also check out our complete training here: www.edureka.co/java-j2ee-soa-training. Cheers!

  • @FirstLast-hm8oz
    @FirstLast-hm8oz 3 года назад +4

    Very informative. Thank you very much ! The installation part is a bit too long and should be more concentrated on new and specific issues regarding ReST.

    • @edurekaIN
      @edurekaIN  3 года назад +1

      Hi, thank you for your valuable feedback, we have considered it . Do subscribe to our channel for more content, cheers :)

  • @muthu8663
    @muthu8663 7 лет назад +10

    really eudreka you guys are very informative and useful videos...

    • @edurekaIN
      @edurekaIN  7 лет назад +1

      Hey Vijay, thanks for the wonderful feedback! We're glad you found our tutorials useful.
      Here's another video that we thought you might like: ruclips.net/video/aqHhpahguVY/видео.html.
      Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!

  • @sivakanagaraj8894
    @sivakanagaraj8894 5 лет назад +4

    Dude you are awesome. I am in this IT industry for last 20 yrs. you are one of a good teacher I have seen.

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Siva, we are glad you feel this way. Do subscribe to the channel and hit the bell icon to never miss an update from us in the future. Cheers!

  • @eunjinko3388
    @eunjinko3388 6 лет назад +4

    This video is a excellent tutorial

    • @edurekaIN
      @edurekaIN  6 лет назад

      Thank you for watching our videos. Do subscribe to our youtube channel and stay updated with our content. Cheers :)

  • @kimkumarrajan
    @kimkumarrajan 5 лет назад +1

    Nice video for beginners :) and very well explained .

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Kim, we are glad you loved the video. Do subscribe to the channel and hit the bell icon to never miss an update from us in the future. Cheers!

  • @sebuhi10
    @sebuhi10 6 лет назад +5

    Hi, explanation is great Thanks But why you don't use example with JSON. I believe it is more common.

    • @edurekaIN
      @edurekaIN  6 лет назад +3

      Hey Sabuhi, thanks for checking out our tutorial.
      This is one of the implementation done through Rest API. There are several methods in Java to implement REST API and JSON is one of those. Since this is a beginner level tutorial, this is the simplest to start off with and that's why we have used it. Cheers!

  • @godservantpk
    @godservantpk 6 лет назад +2

    Super very good explanation crystal clear

    • @edurekaIN
      @edurekaIN  6 лет назад

      Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)

  • @abbasjameel7025
    @abbasjameel7025 5 лет назад

    While launching the application in the browser is it always necessary for the user to give the hard coded value of package name and class name in URL or there is some way we can configure them ?

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Abbas, yes you need to use the hardcoded value. Hope this helps!

  • @varundade
    @varundade 5 лет назад +5

    Thanks Edureka! this video was so helpful hoping more amazing videos from you guys in future...all the best!

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Varun, glad you loved the video. Do subscribe and hit the bell icon to never miss an update from us in the future. Cheers!

  • @arpitsaxena2906
    @arpitsaxena2906 5 лет назад +1

    thank you

  • @manishjangra4332
    @manishjangra4332 6 лет назад +7

    Iol, i don't know what is the issue but after watching this video twice and follow exactly i am still getting 404 in the end.....video is good maybe version problem is the issue

    • @edurekaIN
      @edurekaIN  6 лет назад +1

      Hey Manish, yes version compatibility can be an issue. Try using the same version as used in this tutorial, you will not face this issue. Cheers :)

  • @arjunarjun27
    @arjunarjun27 7 лет назад +4

    i started learning from edureka from java tutorials.Thank you very much

    • @edurekaIN
      @edurekaIN  7 лет назад +1

      Hey Arjun, thanks for checking out our tutorial!
      We're glad you found it useful. Here's another video that we thought you might like: ruclips.net/video/aqHhpahguVY/видео.html.
      Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!

  • @Kumuthapoorvi
    @Kumuthapoorvi 5 лет назад +2

    pace so nice

  • @mihirvalame
    @mihirvalame 5 лет назад +4

    Hello i followed exact steps on latest version of jars and tomcat 9 server but i always get below error 404 with description as 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.'

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Mihir, Did you try running it as admin? That usually solves any firewall block issue. Try it out and let us know.

  • @GopalRoy-nn6ft
    @GopalRoy-nn6ft 6 лет назад +2

    i liked yours teaching style

    • @edurekaIN
      @edurekaIN  6 лет назад

      Hey Gopal, thank you for appreciating oour work. Subscribe and stay tuned for updates in the future. :)

  • @krishnaverma7744
    @krishnaverma7744 6 лет назад +1

    Thanks neel...you really explains thing very well with perfect example.

    • @edurekaIN
      @edurekaIN  6 лет назад

      Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)

  • @harikamisetty
    @harikamisetty 6 лет назад +1

    Nice explanation with in 13 min

    • @edurekaIN
      @edurekaIN  6 лет назад +1

      Hey Hari, we try to make out tutorials short and informative. We are glad that you liked our content. Subscribe to us and stay connected. Cheers :)

  • @sridharsahu08
    @sridharsahu08 7 лет назад +6

    Very Informative Video.
    Towards the end I am still getting 404 error even after following what was said to append /rest/hello at end of url..
    Could you please assist

    • @edurekaIN
      @edurekaIN  7 лет назад

      Hey Sridhar, thanks for the wonderful feedback! We're glad you liked our tutorial.
      There could be two main reasons for this, first could be because of some mistake made in code written in the web.xml file. Second could be because the tomcat server isn't running or is being used by another application. You can also try to access your application from your web browser by going to the path localhost:8080/RestTest/hello
      Hope this helps. Cheers!

    • @edurekaIN
      @edurekaIN  7 лет назад

      Hey Amlan, thanks for checking out our tutorial!
      There could be two reasons for this. First could be because of some mistake made in code written in the web.xml file. Second could be because the tomcat server isn't running or is being used by another application. You can also try to access your application from your web browser by going to the path localhost:8080/RestTest/hello
      Hope this helps. Cheers!

    • @ravaldhiren
      @ravaldhiren 7 лет назад

      Hi I did run on browser and did web.xml as per the tutorial but getting same error .
      HTTP Status 404 - Not Found
      Type Status Report
      Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
      Apache Tomcat/8.5.16

    • @raymondhilario8501
      @raymondhilario8501 6 лет назад +1

      Had the same experience, try this:
      Unable to run the application, had to change some config in the Web.xml on this servlet-class param:
      >>> org.glassfish.jersey.servlet.ServletContainer
      without the ".class" extension and now able to run.
      Hope this helps.

    • @sneharajit41
      @sneharajit41 6 лет назад

      Use org.glassfish.jersey.servlet.ServletContainer instead org.glassfish.jersey.servlet.ServletContainer.class
      Hope this will fix your issue.

  • @krunal921007
    @krunal921007 3 года назад

    Thank you bro. Very nicely explained rest api

    • @edurekaIN
      @edurekaIN  3 года назад

      We are super happy that Edureka is helping you learn better. Your support means a lot to us and it motivated us to create even better learning content and courses experience for you . Do subscribe the channel for more updates : ) Hit the bell icon to never miss an update from our channel : )

  • @santoshturamari
    @santoshturamari 6 лет назад +12

    Followed the tutorial fully, but getting the error java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class in console, and 404 in browser.

    • @santoshturamari
      @santoshturamari 6 лет назад +14

      I could resolve this issue by adding "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" as sevlet-class in web.xml

    • @edurekaIN
      @edurekaIN  6 лет назад +1

      Hey Santosh, Glad it worked out.
      Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!

    • @KatRollo
      @KatRollo 6 лет назад

      This is the correct solution, thanks!

    • @Shubhamsharma-sg3jt
      @Shubhamsharma-sg3jt 6 лет назад

      thanks bro

    • @rbok78
      @rbok78 6 лет назад

      Thanks Santosh for sharing the solution. It might be useful to mention this at the top of the video description so everyone can easily fix the code before reporting the same issue repeatedly.

  • @Randhir-GlobalTraveller
    @Randhir-GlobalTraveller Год назад +1

    Super useful, Thanks !!!

    • @edurekaIN
      @edurekaIN  Год назад

      You're welcome 😊 Glad it was helpful!!!

  • @stsandeep7447
    @stsandeep7447 6 лет назад +1

    Hi ,
    I have put jersey servlet jars in web-inf/lib and library also but still my tomcat not getting up and application is not running, pls help me

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Sandeep, For this, you just have to check whether your tomcat is being set properly, if not re configure all the servers again and make sure servlet.api is present.
      Hope this helps!

  • @tiyatukes9433
    @tiyatukes9433 6 лет назад +2

    So I'm following along with your tutorial, btw, you are a great teacher. So I downloaded jersey and extracted it, but when I open up eclipse, I don't see dynamic web. Since I'm fairly new to this, where else would I look?

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Tiya, For this you need to install eclipse for JavaEE Developers. Here is the link - www.eclipse.org/downloads/packages/release/indigo/sr2/eclipse-ide-java-ee-developers
      Hope this helps!

  • @sabbukarki8575
    @sabbukarki8575 7 лет назад +3

    hello sir. i try to download Jersey but unable to download it. whats an alternative

    • @edurekaIN
      @edurekaIN  7 лет назад

      +Tha buli, thanks for checking out our tutorial!
      You can download Jersey files from the following link: goo.gl/Qie7ZN. You will need to extract the file and copy it inside /WebContent/WEB-INF/lib folder of your dynamic web project. Hope this helps. Cheers!

  • @varundade
    @varundade 5 лет назад +1

    Will we would be able to develop plugins for wordpress?

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Varun, WordPress has various built-in and freely available plugins, you can use any of them. If you wish to learn about how to exclusively create a plug-in for WordPress, we shall consider it.
      Hope this helps!

  • @mayurkulkarni5339
    @mayurkulkarni5339 7 лет назад +2

    hello sir,I have watched your tutorial and it was very helpful .I followed all the steps as shown in the tutorial but then also i m getting " java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class " error ,why so?

    • @edurekaIN
      @edurekaIN  7 лет назад

      Hey Mayur, thanks for checking out our tutorial. We're glad you found it useful.
      With regard to the error, Try to copy your jersey jar files into WebContent -> WEB-INF -> lib.
      Hope this helps. Cheers!

    • @seenu0104
      @seenu0104 6 лет назад +1

      Use "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" in web.xml

    • @abhadra
      @abhadra 6 лет назад

      do not use a .class extension, just org.glassfish.jersey.servlet.ServletContainer

    • @malathikishore6555
      @malathikishore6555 6 лет назад

      remove ".class" from "org.glassfish.jersey.servlet.ServletContainer.class" in web.xml for servlet class & check all libraries are copied to lib or not.

    • @KapilDaJawabNahi
      @KapilDaJawabNahi 6 лет назад

      try setting org.glassfish.jersey.servlet.ServletContainer (without class) as ...
      org.glassfish.jersey.servlet.ServletContainer

  • @gopalkannan4934
    @gopalkannan4934 Год назад +1

    Thank you so much!!!

  • @habtamusium8646
    @habtamusium8646 Год назад +1

    many thanks !

    • @edurekaIN
      @edurekaIN  Год назад

      You're welcome 😊 Glad you liked it!!

  • @SahilMalik-ss6qi
    @SahilMalik-ss6qi 5 лет назад +3

    I am not getting a restart server option after finish , so getting 404 error even after adding rest/hello
    What can I do to solve it?

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Sahil, Check if you have done proper configuration changes for Rest service in web.xml and if you are still getting the error post the exact code that you have used.

    • @rockeeenagra
      @rockeeenagra 5 лет назад +1

      Remove ".class" from servletContainer.class in tag servlet-class in web.xml, if already done then check for errors in console while server startup

    • @nishalohani
      @nishalohani 5 лет назад

      @@edurekaIN Thanks for the video. Even I am getting 404 error even after adding rest/hello, refer web.xml content
      JavaAPI


      Java API
      org.glassfish.jersey.servlet.ServletContainer.class

      jersey.config.server.provider.packages
      test

      1


      Java API
      /rest/*

  • @sow223
    @sow223 5 лет назад +1

    how to consume the web services either soap or restful

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Sowbhagya, "searchmicroservices.techtarget.com/tip/REST-vs-SOAP-Choosing-the-best-web-service
      Refer this blog. It might be of some help to you."

  • @vaibhavkamble7076
    @vaibhavkamble7076 2 года назад +1

    Getting Status 404
    The origin server did not find a current representation for the target resource or is not willing to disclose that one exists
    After following all steps you have shown in video

  • @kumaraneesh1420
    @kumaraneesh1420 2 года назад +1

    How to communicate & fetch details from different applications using REST API with url ..Kindly share video asap.

    • @edurekaIN
      @edurekaIN  2 года назад

      Thanks for showing interest in edureka kindly visit the channel for more videos our content creators are eagerly waiting for your suggestion to make new videos on your interest :) DO subscribe for the video update

  • @RahulSingh-iy3ir
    @RahulSingh-iy3ir 2 года назад +1

    It is showing error as error is showing in console org.apache.concurrent.excecutionexception
    Then the error coming in dialogue box as
    starting tomcat v9.0 server at localhost has encountered a problem.
    Server tomcat v9.0 server at localhost failed to start

  • @mukulmohal7492
    @mukulmohal7492 6 лет назад +1

    I am not able to view xml response, it is always giving error as whitespace is not allowed at this location.

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Mukul, "Put the string in a block as below:

  • @danielmoreira204
    @danielmoreira204 2 года назад

    kinda useful

  • @TM-lf6os
    @TM-lf6os 5 лет назад +1

    Had a port issue when trying to start the server, said 'Several ports (8005, 8080, 8009) required by Tomcat v8.5 Server at localhost are already in use.'
    Double-clicked the server down below in bottom window on Eclipse, changed server Port numbers from 8005, 8080, 8009, to 8008 (respectively), and that seemed to fix the issue.

  • @dileepkumar-oh1be
    @dileepkumar-oh1be 5 лет назад

    great explaination

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Dileep, we are glad you loved the video. Do subscribe and hit the bell icon to never miss an update from us in the future. Cheers!

  • @MovingDirection
    @MovingDirection 6 лет назад +5

    I am facing an issue. Trying 2 many times still getting an error 404. I have done exactly the same thing which u are doing in ur video. Assist me asap

    • @edurekaIN
      @edurekaIN  6 лет назад

      Hey Musicat, can you tell us the exact error that you faced along with screenshot. We will definitely try helping you out. Cheers :)

    • @narayanasrikarbonda4634
      @narayanasrikarbonda4634 6 лет назад +10

      I could resolve this issue by adding "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" as sevlet-class in web.xml..credits goes to @santosh BT

    • @leokamikkaze20
      @leokamikkaze20 5 лет назад +2

      I was having the same issue and removing the ".class" worked, thanks

    • @narasimhayTECHHRC
      @narasimhayTECHHRC 5 лет назад

      Worked Great thanks Bro.

    • @Az-dk8jd
      @Az-dk8jd 5 лет назад

      thaks @narayana srikar
      it works by removing this .class

  • @pranavipalavarapu9431
    @pranavipalavarapu9431 5 лет назад

    how to create api key

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hi Pranavi, Go to the API Console.
      From the projects list, select a project or create a new one.
      If the APIs & services page isn't already open, open the left side menu and select APIs & services.
      On the left, choose Credentials.
      Click Create credentials and then select API key.

  • @SubelalPal
    @SubelalPal 6 лет назад +1

    404 error is coming->localhost:7080/JavaAPI/rest/hello please help me about this type issue

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Subelay, "You can try changing your port to 8080 instead of 7080. If the issue persists, you can reach back to us, we would be glad to help."

  • @ravindranathreddy4796
    @ravindranathreddy4796 6 лет назад +2

    Hi Sir, its is really help full... could you please help me Usage of POST method use and how to insert with out useing queryParam ?

    • @edurekaIN
      @edurekaIN  6 лет назад +1

      Usage of POST in webswervice: if server is responsible for creating the ID's of the new resources then use POST, for example
      POST /users/
      Now, POST will carry a key and value which client uses to send username=john and ID will be automatically generated by Server.
      Withour @queryParams(): You can get the query parameters grammatically, via “@Context UriInfo“ for example: import java.util.List;
      import javax.ws.rs.GET;
      import javax.ws.rs.Path;
      import javax.ws.rs.core.Context;
      import javax.ws.rs.core.Response;
      import javax.ws.rs.core.UriInfo;
      @Path("/users")
      public class UserService {
      @GET
      @Path("/query")
      public Response getUsers(@Context UriInfo info) {
      String from = info.getQueryParameters().getFirst("from");
      String to = info.getQueryParameters().getFirst("to");
      List orderBy = info.getQueryParameters().get("orderBy");
      return Response
      .status(200)
      .entity("getUsers is called, from : " + from + ", to : " + to
      + ", orderBy" + orderBy.toString()).build();
      }
      }
      Hope this helps :)

  • @TM-lf6os
    @TM-lf6os 5 лет назад +1

    Strange issue: my code is identical to yours, but if I included the ApplicationPath and core.Application packages, it returns a blank page when running server. If I do include them, it returns the "Hello from HTML" line, even though it is the third method listed....why is this?

    • @edurekaIN
      @edurekaIN  5 лет назад

      Hey Edward, Can you please elaborate? have you tried stopping and restarting the service? That usually solves this issue.

  • @satindergill9735
    @satindergill9735 5 лет назад

    All the people who are getting 404 error, try to run the app in postman or in browser once the server is started. You will be good. Good luck.

  • @zael7848
    @zael7848 6 лет назад +2

    Thank you very much!!!