REST Web Services 13 - Creating a Resource

  Рет қаралды 383,084

Java Brains

Java Brains

Күн бұрын

Пікірлер: 163
@harineemosur6530
@harineemosur6530 9 жыл бұрын
I have never found an Indian online site teaching so clearly. Its very helpful and very easy to understand. Thanks Koushik
@shobhitsingh7735
@shobhitsingh7735 3 жыл бұрын
Honestly, don't have words to describe how beautiful and perfect this tutorial is. Perfection indeed.
@ricardog.p2610
@ricardog.p2610 8 жыл бұрын
One of the best tutorials I saw, with each line explanation! Congratulations to extend you knowledge, over the community
@aliasgar1648
@aliasgar1648 7 жыл бұрын
This is one of the most mind blowing explanation i have ever come across. Can't thank enough !!
@WholeNewLevel2018
@WholeNewLevel2018 7 жыл бұрын
The Best tutorial on RestWeb services .... Thanks for the amazing work!
@parth191079
@parth191079 9 жыл бұрын
It's great to see this list getting updated with new content and style! Thanks a lot, Koushik!!
@shrutikanachankar4932
@shrutikanachankar4932 6 жыл бұрын
I was getting 404 after restarting server many types and I had checked code multiple times .. it was absolutely fine. It worked for me when I deleted MessageResource class and rewrote. Thank You Kaushik for great trainings.
@ИльясКаримов-д1з
@ИльясКаримов-д1з 5 жыл бұрын
Thanks Koushik. Your channel is amazing. Very, very good materials. God bless you.
@vamsikrishk
@vamsikrishk 9 жыл бұрын
Kudos to you koushik, keep rocking... Simple and very easy to understand the concepts... I wonder by seeing dislikes for this video. Whoever it is, please try to understand that knowledge sharing is not a small thing and think twice before doing that. Please try to explain your view if you are going to dislike it so that people will try to correct it (if any), simple dislike will not take any effect.
@elderofzion
@elderofzion 7 жыл бұрын
disliked by soap fans
@JonathanGonzalez-kk3zu
@JonathanGonzalez-kk3zu 7 жыл бұрын
absolutely amazing videos.. i cannot thank this guy enough.
@Modern_revolution
@Modern_revolution 7 жыл бұрын
Simply simplified tutorial. Thanks a ton!
@gimmeshelter1969
@gimmeshelter1969 9 жыл бұрын
Excellent explanation of the coding of REST resource. Thanks!
@anitaramoliya984
@anitaramoliya984 9 жыл бұрын
Thank you so much Koushik .It is really simple to understand .Please keep publishing such videos .
@sunilkj8281
@sunilkj8281 2 жыл бұрын
You are an amazing teacher, thanks for explaining so clearly.
@humbertoquintanabarrios4589
@humbertoquintanabarrios4589 9 жыл бұрын
Great tutorial. I hope you keep doing this. Thanks a lot.
@johnsimons539
@johnsimons539 9 жыл бұрын
Just a heads up, I kept getting a 404 when trying this, make sure the server is started as I had not noticed it prompted me to restart it
@ramireddy4700
@ramireddy4700 4 жыл бұрын
You done a great job,it helped lot who are more enthusiasm to learn webservices like me,thanks a lot
@zoalallah
@zoalallah 9 жыл бұрын
Hi, Koushik. @2:28 you could've used Shift+(* of the numeric pad) to expand all folders in that tree. And thank you for the wonderful explanation.
@pkenedysingh
@pkenedysingh 9 жыл бұрын
love to see next Video.. Really nice one thanks a lot..
@samdsm2009
@samdsm2009 8 жыл бұрын
Koushik, nicely explained. good job. 👍👍
@mmgaleano
@mmgaleano 8 жыл бұрын
Great tutorial. You are a great teacher
@Daily-digital
@Daily-digital 7 жыл бұрын
You are a fantastic teacher.
@REPLYGAURAV78
@REPLYGAURAV78 7 жыл бұрын
Take a bow Dear :) God bless you..!
@pradyumnakumarsingh6289
@pradyumnakumarsingh6289 6 жыл бұрын
It's very helpful. Thanks Koushik.
@FromLakshmi
@FromLakshmi 9 жыл бұрын
thanku so much. Its been a brilliant share of knowledge. :). We hope to see a good big-sized array of videos talking about Rest.
@Addakar
@Addakar 9 жыл бұрын
I look forward to the next parts :)
@sravanthikakani
@sravanthikakani 9 жыл бұрын
thank you for videos .. hope to see complete program next videos as soon as possible ,as it is always in my mind
@kefetDtcom
@kefetDtcom 9 жыл бұрын
waiting the rest of the videos :)
@adityapachigolla5938
@adityapachigolla5938 7 жыл бұрын
Fantastic videos, You made really simple. Thanks
@sripasum3122
@sripasum3122 9 жыл бұрын
love these videos; keep them coming
@kishorlohare2589
@kishorlohare2589 9 жыл бұрын
you are simply superb..
@irfanaippu6533
@irfanaippu6533 3 жыл бұрын
Awesome.a big Thanks for this ...
@HeliosFire9ll
@HeliosFire9ll 7 жыл бұрын
For anyone having issues, I'd recommend cleaning and rebuilding the project you're working on. This should update and rebuild your project with the new code you put in.
@soniak8888
@soniak8888 4 жыл бұрын
First of all must say that your sessions are very well articulated and presented. Just wanted to check with you in case you have any sessions on Automatic the Service API's from SIT testing perspective. Let me know in case you need more details regarding my question
@harneetsingh07
@harneetsingh07 7 жыл бұрын
@9:17 avoid using slash infront of messages. Use @Path("messages") instead of @Path("/messages")
@sagarvyas9367
@sagarvyas9367 9 жыл бұрын
Thanks for sharing and make this open source :)
@milindmore1977
@milindmore1977 9 жыл бұрын
Realy Nice tutorial ! Thanks
@sepraveen
@sepraveen 5 жыл бұрын
If you know the spring MVC this could never be more easy.
@osvaldoleiva678
@osvaldoleiva678 4 жыл бұрын
in the same way know this and then learn spring MVC, i think no?
@juan2416mx
@juan2416mx 9 жыл бұрын
Great video please please publish the others thanks u a lot.
@weijiasun4616
@weijiasun4616 6 жыл бұрын
Again, you are the best! Thx
@ckbne
@ckbne 9 жыл бұрын
Fantastic, thank you so much.
@AK-km2kd
@AK-km2kd 6 жыл бұрын
Thank you very much. You made it so simple.
@SaifulIslam-ns6bi
@SaifulIslam-ns6bi 9 жыл бұрын
Thx. waiting for the next video..
@AmongDragons
@AmongDragons 6 жыл бұрын
To anyone having the 404 problem and restarting the server/eclipse didn't fix the issue, do this. Project → Properties → Target Runtimes → Apache Tomcat (checkbox and apply and close). This only happens if there is an errorcode "the superclass javax.servlet.http.httpservlet was not found".
@Rajesh-hi6eu
@Rajesh-hi6eu 9 жыл бұрын
Kudos to you Koushik...easiest to learn ...so simple.simply amazing... Just one query how many more how many more tutorial is there on this and when are you planning to upload?
@shashgo
@shashgo 7 жыл бұрын
Kaushik, You put the annotation @GET for the jersee API to find the method, but where in the URL have you specified that it is a get request, so that the API knows to look for the @GET annotation
@edon1257
@edon1257 9 жыл бұрын
Thanks a lot for those great tutorials. But I have some questions for you: Why have you decided to make RESTful services with JAX-RS and not with Spring MVC . Can you explain me if there is any difference or advantage of using one or another ? And do you plan to make any tutorial about Spring MVC ? Thanks again, you are amazing. Keep going!
@inerc805
@inerc805 9 жыл бұрын
It is cool man, thx from Russia
@somyagupta922
@somyagupta922 4 жыл бұрын
very well explained
@barbaraszczygielska4565
@barbaraszczygielska4565 8 жыл бұрын
Thanks a lot for this course :)
@volkerreichel2285
@volkerreichel2285 9 жыл бұрын
Thanks alot! Good explanations.
@ramkrishnadixit8838
@ramkrishnadixit8838 8 жыл бұрын
Hi Koushik, After creating the class MessageResource, when did you build the project ? There should be a build project after creating resource and then only you can see it on browser ?
@mahendrapratap6256
@mahendrapratap6256 8 жыл бұрын
yes he might have done that .
@soniamiglani8720
@soniamiglani8720 6 жыл бұрын
It works after number of restart the server.. Also please make sure every thing is as according as mentioned in the video . for ex. @Path before class, GET and Produce before method...
@shashgo
@shashgo 7 жыл бұрын
Kaushik, It seems that the ending of the URL "/messages" doesnt care whether the class belongs to the messenger package or to a subpackage of messenger, because in the previous tutorial "/myresource" called on a class that was in the messenger package, and the beginning of the URL was still the same ".../messenger/webapi. In other words, for the previous example, the URL was "localhost:8080/messenger/webapi/myresource" and the class referred to was in the messenger package For the example in this tutorial, the URL is "localhost:8080/messenger/webapi/messages" even though the class referred to is in the messenger.resources class. So, basically the Jersey API is looking for any classes that have paths that match the end of the URL without regard to the actual package. Why then did you create different subpackages and not just create the MessageResource class in the messenger package instead of in a subpackage?
@priyanair2048
@priyanair2048 7 жыл бұрын
Good one:) Got it worked
@LearnKuCode
@LearnKuCode 7 жыл бұрын
Beautiful, thanks
@PriyaRanjanPrakash
@PriyaRanjanPrakash 9 жыл бұрын
nice series (y)
@erfelipe
@erfelipe 4 жыл бұрын
Currently I wasted a lot of time to find in the stackoverflow that tomcat 9 cannot be used with jefrey 3. But the examples are great. Thanks for the lessons.
@pavan369
@pavan369 8 жыл бұрын
Must see that your 'MessageResource' file is under the same package as the 'MyResource' file. It will work for sure. :)
@MRFix722
@MRFix722 8 жыл бұрын
Thank you so much!.
@artemgoncharenko646
@artemgoncharenko646 7 жыл бұрын
Can anyone answer: What if I put @GET annotation above the second method in the class? @GET public String getMessages(){...} @GET public String getSomeMessages(){...} How does Jersey know what method to invoke for the url localhost:8080/messenger/webapi/messages ?
@nagarjuna.p7252
@nagarjuna.p7252 7 жыл бұрын
created new class like MessageResource.while calling webapi/messages gives 404 error
@shashgo
@shashgo 7 жыл бұрын
kaushik, What is the 1
@smithdragon6477
@smithdragon6477 6 жыл бұрын
hey teacher what is the difference between jersy and spring mvc @requestmapping in spring
@Er.AnkitT
@Er.AnkitT 2 жыл бұрын
Hello Sir When I am clicking on Jersey resource I am getting Tomcat 404 error The origin server did not find a current representation for the target resource or is not willing to disclose that on exists.
@Er.AnkitT
@Er.AnkitT 2 жыл бұрын
Please Help on this
@paveltuz8403
@paveltuz8403 7 жыл бұрын
I completely have broken my brain when trying to define package structure looking to eclipce package(Java Resources) tree at 7:35. Why don't you use Intellij IDEA ? It much more convenient
@amanagarwal990
@amanagarwal990 7 жыл бұрын
Why do we have @Path("myresource") and not @Path("webapi/myresource") ? How is the link in @Path annotation decided ?
@someperson9536
@someperson9536 4 жыл бұрын
Can a database connection be made in the resource class? I would like to practice making a database connection and retrieving data from a database. Are there any practice databases in the cloud that anyone can use for free?
@prashantsharma8366
@prashantsharma8366 8 жыл бұрын
Hey Koushik, Really Enjoying your videos.Have a Question again "404 exception is occurring when i remove /webapi from the href, servlet mapping of web.xml. Is it necessary for RESTful and where is it defined." Regards Prashant Sharma
@manuelcuambeify
@manuelcuambeify Жыл бұрын
If I have multiple Post Method or Get Method how is the mapping work inthis context
@jonassx100
@jonassx100 6 жыл бұрын
what is there are two methods of different name mith same @GET method
@kirankumar-yw1mo
@kirankumar-yw1mo 6 жыл бұрын
Hi Kousik, how to add glassfish in jave 1.8. For me , when i add maven project, it is comming like "org.apache.maven.archtypes ". kindly help me with steps
@swamyas5668
@swamyas5668 4 жыл бұрын
Wow and Thanks
@Stefan1971HH
@Stefan1971HH Жыл бұрын
It works for me with the MyResource Class, but with MessageResource I keep getting 404. I tried all suggestions from the comments (removing the slash, restarting the server...) but no success. Any help? Thanks
@kowserparvez3355
@kowserparvez3355 6 жыл бұрын
i know its an old post .. but i can use some help ... getting errors when i @Produces(MediaType.TEXT_PLAIN).. says testplain cannot be resolve in this field. thanks
@kathy27196
@kathy27196 7 жыл бұрын
My tomcat could not reload the context messenger at will. I have tried save the file + restart the server + run on server, even tried buid project or refresh. Even restating server could not reload the updated version. But it seems tomcat has its own reloading time. Only when it start reloading by itself, the updated version get reloaded.
@philhamilton3946
@philhamilton3946 9 жыл бұрын
I cannot get this to work. On your web site JavaBrains you have a note: "Make sure your class is in the package configured in Jersey servlet's init-param" What does this mean? How do I make sure? Which package? Enjoy your videos.
@harshghosh2293
@harshghosh2293 6 жыл бұрын
This webservice creation is not clear Kaushik. Firstly I am not able to replicate the package structure you have. Then without changing the jsp with messages, how servlet will identify them correct java file? Please respond. Generic package name in Web.xml is also not helping. Please respond.
@paveltuz8403
@paveltuz8403 7 жыл бұрын
If I excludes "webapi" prefix from web.xml and index.jsp to simplify the url for users the application stop working, Have got 404 error. How web.xml url-pattern and index.jsp href must look like to make it work?
@gov914
@gov914 9 жыл бұрын
Thank you!
@ragavkrishna2652
@ragavkrishna2652 8 жыл бұрын
Hi Kaushik, Thanks a lot for your tutorial. Every time I add a resource I am not able to access the URL until I restart the server. I created a new resource called 'ExampleResource' similar to the 'MessageResource' and until I restarted the server (right click on project -> run on server -> restart server), I received 404 error. please let me know if this is a configuration issue or if this is a standard procedure. Thanks!
@SahilKaironVlogs
@SahilKaironVlogs 3 жыл бұрын
facing the same issue. Have you resolved it. Please reply if there is any issue with the configurations.
@syedwaseemahmed1749
@syedwaseemahmed1749 7 жыл бұрын
Hi Koushik, Can you please tell how to get sourse code of this tutorial?? Thank's & Regard's Sd.Waseem
@rajeshkusamantaray7283
@rajeshkusamantaray7283 7 жыл бұрын
github.com/koushikkothagal/messenger/archive/43f5a224b7de3099fbd96deee7c0ddb3706059f2.zip
@tanvipatel7911
@tanvipatel7911 8 жыл бұрын
awesome!
@SwatiGuptabprofessional
@SwatiGuptabprofessional 9 жыл бұрын
i get HTTP Status 404 - Not Found error when i click on " jersey resources" . How to resolve it ?
@RamDixitPro
@RamDixitPro 8 жыл бұрын
Hi Koushik, I was getting error in eclipse while using annotation @Produces(MediaType.TEXT_PLAIN). because by default eclipse added import of "import javax.enterprise.inject.Produces;" instead of "import javax.ws.rs.Produces". Please mention this in the tutorial itself, to make it easier for beginners.
@errrzarrr
@errrzarrr 8 жыл бұрын
+Ram Dixit because maybe you didn't noticed but you told Eclipse to import that package, which has a Produces class too. Just import the correct one.
@ManojJawalkar
@ManojJawalkar 8 жыл бұрын
I have imported javax.ws.rs.Produces but still getting error "TEXT_PLAIN cannot be resolved or is not a field". What is the reason?
@ManojJawalkar
@ManojJawalkar 8 жыл бұрын
Sorry! wrong importjava.awt.PageAttributes. use javax.ws.rs.core.MediaType instead
@bonioctavianus199
@bonioctavianus199 9 жыл бұрын
i notice there is message on console : "INFO: Reloading Context with name [/...] is completed" every time i make change on code, i think it's like reloading, then after 5 seconds, the changes applied
@kushcabba
@kushcabba 9 жыл бұрын
It takes a few replays of this videos to really get it. At first I was drowning in all the information lol
@mallikarjunna9265
@mallikarjunna9265 7 жыл бұрын
Hi koushik, I am getting error while creating a new resource . I have tried changing the URL restart of the Server,cleaning the project and restarting eclipse but it is not working can any one help me on this.
@minhtruong7605
@minhtruong7605 7 жыл бұрын
If anyone has 404 error. Just reset your Eclipse. It totally worked for me.
@abhijith2201
@abhijith2201 9 жыл бұрын
the @PATH("/messages") is wrong , everyone please try with @PATH("messages") and restart tomcat , it should work
@balaji.r788
@balaji.r788 7 жыл бұрын
Yes its @PATH("Messages").Thanks
@naskar23
@naskar23 7 жыл бұрын
but it worked perfectly fine with "@Path("/messages")"
@sam.kendrick
@sam.kendrick 7 жыл бұрын
I initially got a 404, but I just waited a few seconds and tried it again. I think the server takes a second to reload.
@zookeeper4482
@zookeeper4482 7 жыл бұрын
It's not wrong.
@NotNotNithin
@NotNotNithin 7 жыл бұрын
/messages is not wrong or else how would Koushik get the output? You should restart your server once and it works fine.
@fool123
@fool123 9 жыл бұрын
i get a 404 when going to /messages. any ideea why ? i'm doing it in netbeans 8.0.2 btw, i don't think it matters though and i don't think i've missed anything :-s
@fool123
@fool123 9 жыл бұрын
ASSDQ restarted netbeans and works...fk this ide only had problems with it from the beginning. props on the tutorial too ! thx !
@8o8inSquares
@8o8inSquares 9 жыл бұрын
+ASSDQ You had to restart the server lol
@Dragosknight
@Dragosknight 9 жыл бұрын
Intellij Idea HTTP Status 404 - Not Found type Status report message Not Found description The requested resource is not available. Apache Tomcat/8.0.24
@nostalgiaTune
@nostalgiaTune 9 жыл бұрын
+vinay ganesh.d Did you make the class public?
@tomasreynoso
@tomasreynoso 9 жыл бұрын
I used to have the same problem. My getMessages() method doesn't have the public accesibility
@taraszhupnyk2998
@taraszhupnyk2998 9 жыл бұрын
How to create this project in Intellij IDEA?
@Java.Brains
@Java.Brains 9 жыл бұрын
Taras Zhupnik I'm sure IntelliJ has a Maven project creation function. Look it up!
@SoeaOu
@SoeaOu 9 жыл бұрын
+Java Brains procedure is pretty much the same as in eclipse, it can also be done from command line and then imported to intellij as a maven project
@koushikdas2755
@koushikdas2755 5 жыл бұрын
I like to know, How servlet internally calls the web resource.
@최진우-y8s
@최진우-y8s 9 жыл бұрын
how to setup this project in linux? is it possible?
@SoeaOu
@SoeaOu 9 жыл бұрын
+CHOI JERENO yes, use maven from command line, this is pretty much designed to work on linux machines
@shahidkhan8082
@shahidkhan8082 4 жыл бұрын
i got 404 error i uses 2.6 jax rs java8 and tomcat 9
@milantrehan178
@milantrehan178 4 жыл бұрын
I kept getting 404, and after trying a lot of times I found the thing that I was missing -"public" modifier for getMessages() .
@vnikie1
@vnikie1 9 жыл бұрын
thanks a lot!!
@amitrathod3074
@amitrathod3074 6 жыл бұрын
HI a i am facing issue while running localhost:8013/messanger/webapi/messages Type Status Report Message Not Found Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. please help me out
@abdussamadibnmoore5219
@abdussamadibnmoore5219 9 жыл бұрын
My applicatin work. but it will only accept uppercase Messenger in the url. Anyone knows why?
REST Web Services 14 - Returning XML Response
10:53
Java Brains
Рет қаралды 354 М.
REST Web Services 12 - Understanding the Application Structure
7:55
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Creating a Restful webservice in java
18:53
yrrhelp
Рет қаралды 314 М.
Programming Is NOT Enough | Add these 7 skills…
13:19
Travis Media
Рет қаралды 424 М.
REST Web Services 01 - Introduction
16:36
Java Brains
Рет қаралды 1,7 МЛН
REST Web Services 11 - Setting Up
10:45
Java Brains
Рет қаралды 473 М.
Creating SOAP Web Service with Spring Boot | java Techie
31:54
Java Techie
Рет қаралды 155 М.
REST Web Services 27 - Handling Exceptions
17:54
Java Brains
Рет қаралды 186 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 224 М.