#5 Servlet and JSP Tutorial | Create Servlet and web.xml Config

Ғылым және технология

Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
TELUSKO Android App : bit.ly/TeluskoApp
Discord : / discord
Complete Servlet and JSP playlist : goo.gl/pKFeSv
In this video will see the handelling of request and response objects using servlet.
We will see :
- Form handling
- Create new Servlet class which extends HttpsServlet
- service() method
- Request object
- Response object
- Passing value
- request.getParameter method
- Query String
- Deployment Descriptor
- web.xml file
- servlet and servlet-mapping tags
- Fully qualified name
- Accepting values from user
- Printing the result on page
A servlet is a Java programming language class that is used to extend the capabilities of servers that host applications accessed by means of a request-response programming model.
Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers. For such applications, Java Servlet technology defines HTTP-specific servlet classes.
The javax.servlet and javax.servlet.http packages provide interfaces and classes for writing servlets.
All servlets must implement the Servlet interface, which defines life-cycle methods. When implementing a generic service, you can use or extend the GenericServlet class provided with the Java Servlet API.
The HttpServlet class provides methods, such as doGet and doPost, for handling HTTP-specific services.
Java and Spring Framework For beginners with Spring Boot : - bit.ly/3LDMj8D
Java Tutorial for Beginners (2023) :- bit.ly/3yARVbN
Editing Monitors :
amzn.to/2RfKWgL
amzn.to/2Q665JW
amzn.to/2OUP21a.
Subscribe to our other channel:
Navin Reddy : kzread.info/dron/xmk.html...
Telusko Hindi :
kzread.info/dron/itz.html...
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
www.telusko.com/contactus

Пікірлер: 365

  • @omaralkhalisi4354
    @omaralkhalisi43545 жыл бұрын

    I've been looking for someone to teach me how to deploy java programs that we learned in school into a website. this channel is exactly what I was looking for. THANK YOU SO MUCH

  • @varunreddy9806
    @varunreddy98062 жыл бұрын

    I don’t understand why lecturer’s in clg make this simple topic look so complicated with their teaching . Really your teaching helped sir . Thank you ❤️

  • @shashikalaraju5769
    @shashikalaraju57694 жыл бұрын

    I cant thank you enough for putting up these videos for us to learn. There's no other video in the whole of youtube that is as useful and good as this. Thank you is all I can say.

  • @kakaoringo0929
    @kakaoringo09294 жыл бұрын

    seriously you are my SAVIOR 😭 I had been struggling a lot from understanding how to do these codings... THANK YOU SO MUCH!!!!!

  • @techmoon_
    @techmoon_2 жыл бұрын

    I dont even know what I will do without you my dear teacher....!!!! I started practicing servlet and getting error out of the world. I searched all websites, stackoverflow,stackexchange,etc.... and lot of unknown name websites.... After that I watched your playlist and started practicing ... THE END!!!!!!!! No words can describe my thank to you. You are the BEST!!!!!!!!!!!!!!!!!!!!!!!

  • @PANKAJKUMAR-fe8zn
    @PANKAJKUMAR-fe8zn4 жыл бұрын

    Thank you very much sir... because of your tutorial,I am able to understand better these concepts otherwise, I have spend lakhs of rupees on my degree but not interested in classroom lectures. KZreadr like you and other are making a good software developer who has good concepts of the subject. love you sir....♥️♥️♥️♥️

  • @starman9000
    @starman90003 жыл бұрын

    I am coming from .Net background! Needed to learn JSP to work on in one of the project, I felt Servalet and web.xml is so funny ! You are great teacher and have real good teaching method. I love the way you explain in depth. I enjoyed it. Thank you for making this video.

  • @lodashnotebook5390
    @lodashnotebook53904 жыл бұрын

    Amazing. This was hands down the best video I have seen on your channel. Keep up the good work. I will surely meet you if you're in Mumbai!

  • @chiranjeetparida263
    @chiranjeetparida2634 жыл бұрын

    Sir u are really splendid. Your explanation is simplified and crystal clear. Also ur communication skill is damn good. Thanks for such tutorials which makes learning a fun.

  • @curseb100d26
    @curseb100d26 Жыл бұрын

    Now Java Servlet make sense to me big thanks on your step-by-step playlist 💯

  • @poladalqayev631
    @poladalqayev6316 жыл бұрын

    Thanks , man for your all tutorials and videos ! You are exactly person who we are looking for !

  • @jamestran1719
    @jamestran17196 жыл бұрын

    the best teaching technique i have ever seen. appreciate your time . thank a lot

  • @thedrunkmonk8386
    @thedrunkmonk83864 жыл бұрын

    Very clear, thank you. My database professor simply said final project is a web application, use whatever. :'D I used some javascript last year but I don't remember much, we've just finished a project using jdbc, so I understand that well enough, but for the in-between I had no idea.

  • @shoebkhan1503
    @shoebkhan15034 жыл бұрын

    Thank you very much. The way to create the problem intentionally and tell the solution was best!!

  • @lodashnotebook5390

    @lodashnotebook5390

    4 жыл бұрын

    Yeah. That comes thru practice. But I knew Sysout prints to the console so I caught that one!

  • @dharmang
    @dharmang4 жыл бұрын

    Best video series for Adv. java. Just learning in advance so that i can laze around in class and only do practicals instead of theory hahaha 😂

  • @thiago670
    @thiago6706 жыл бұрын

    I really like of your classes, very good! Do you use servelets in your projects?

  • @stursshiphez7559
    @stursshiphez75593 жыл бұрын

    You are a blessing, sir. Keep doing the good work ❤️

  • @akshayn7687
    @akshayn76872 жыл бұрын

    Thank you so so so much Sir.....I don't understand this at the class ....but after watching this video I understand all this things.....😍 keep doing sir😍👍🏻

  • @hanishvenkat9496
    @hanishvenkat94967 ай бұрын

    your videos always provides the best information .....thank you

  • @maveone2
    @maveone26 жыл бұрын

    Hi Naveen , great tuts.. Thanks for helping us... Had a small confusion.. Coming to servlet mapping , i do not have the tags in web.xml, yet my servlet deployed properly. Also while creating the servlet, in deployment description window, i mentioned a vague path to test like "/anything/test" , but it deployed again properly.. How was that?

  • @tusharadhatrao4749
    @tusharadhatrao47493 жыл бұрын

    Thank you soo much sir!!! I was trying to run servlets for 2 days!!

  • @ankitaB11
    @ankitaB11 Жыл бұрын

    This is hands down the best. End of story

  • @domb3665
    @domb36655 жыл бұрын

    Thanks, I really need to understand how web.xml works so this was a help

  • @Development_In_Research
    @Development_In_Research2 жыл бұрын

    i was struglling for last 4 hrs, finally tqqqqqqqq

  • @xyzabc6898
    @xyzabc68983 жыл бұрын

    THANK YOU SIR, you Cleared this Concept in Java ....

  • @arpita0608
    @arpita06085 жыл бұрын

    thankyou bhaiya your playlist are amazing..u really teach well

  • @chinli72
    @chinli722 жыл бұрын

    Best video on servlet, simple and clear.

  • @dhirajshalgar5015
    @dhirajshalgar50153 жыл бұрын

    Hello sir I have got 1 error of 404. Says that, " the origin server did not find a current representation for the target resource or is not willing to disclose that one exists. "

  • @sita476

    @sita476

    2 жыл бұрын

    Have you resolved it?

  • @venpolis8258
    @venpolis82586 жыл бұрын

    Hi....Naveen Sir, why do we write "/add" instead of "add" at the tag in web.xml file

  • @berkercin6800
    @berkercin68005 жыл бұрын

    you have named your texts num1 and num2 and in AddServlet class when you request parameter you write "num1" and "num2" are those have to be the same?

  • @dhananjaygohil1527
    @dhananjaygohil15275 жыл бұрын

    You are a very good teacher sir.

  • @gopalbharadva9623
    @gopalbharadva96235 жыл бұрын

    Sir you are amazing i understand very much from your tutorials and in my college there are faculties which have nothing knowledge to teach us Even they don't know how to print hello world in any programming language

  • @nc840
    @nc8403 жыл бұрын

    The origin server did not find a current representation for the target source or is not willing to disclose that one exists. I had that kind of problem and I solved it. I deleted eclipse and tomcat. and again I downloaded and installed them and it finally works. cheers :)

  • @muthulakshmiram7622
    @muthulakshmiram76222 жыл бұрын

    Thank you Navin... It's truely amazing and thanks again

  • @digitalcity3153
    @digitalcity31535 жыл бұрын

    Wow.... your Explanation is great sir

  • @anjupanicker7934
    @anjupanicker79343 жыл бұрын

    Jeez Thanks a lot I owe my life to this vid

  • @prathamchitransh5338
    @prathamchitransh53382 жыл бұрын

    In my web.xml file there is a predefine code of 4726 lines but in your case there are only 16 line how to resolve this?

  • @junaidansari95
    @junaidansari956 жыл бұрын

    Super tutorials by superman! Lol

  • @bharathirv8479
    @bharathirv84795 жыл бұрын

    I have one doubt. in this tutorial, u created one HTML file under web content. so it's default location. if I have many HTML files how I host the all HTML files from separate folder .ex webcontent/html/index.html is possible .if possible how to do that.

  • @chandranihalder8713
    @chandranihalder87136 жыл бұрын

    Awesome tutorial, thanks!

  • @sunnyparmar9692
    @sunnyparmar96925 жыл бұрын

    This was a very helpful video indeed.. thank you

  • @p9bklokendrabhajane255
    @p9bklokendrabhajane2553 жыл бұрын

    Awesome channel for me . Salute to you Sir..

  • @aastha4708
    @aastha47083 жыл бұрын

    you have amazing knowlegde sir...hatts off to you and thanks for sharing...

  • @MuhammadUsman-ke1sl
    @MuhammadUsman-ke1sl3 жыл бұрын

    Excellent Content, well explained, well programmed

  • @ashwanipanchal7467
    @ashwanipanchal74675 жыл бұрын

    Sir i'm doing this same thing PrintWriter out = res.getWriter(); out.println("REsult"); but result is still showing on console. what should i do now sir help me.

  • @sunnyjain630
    @sunnyjain6304 жыл бұрын

    thanks sir for this lucid way of teaching....

  • @tejaswibhargava8745
    @tejaswibhargava87454 жыл бұрын

    PLZZZ HELP ME WITH THE DOUBT!! We can use doGet() instead of using service() right?? if yes then how is using service() different from using doGet()

  • @shailjakantupadhyay5183
    @shailjakantupadhyay51835 жыл бұрын

    Sir Please help me, does index.html is the one where program started running ? Who initiated the program ?

  • @rusnardo17
    @rusnardo173 жыл бұрын

    Thank you very much, very well explained.

  • @swordrohit07
    @swordrohit073 жыл бұрын

    very clear explanation ..great tutorial

  • @RoguePow
    @RoguePow5 жыл бұрын

    im trying to do the same, servlets with jsp in tomcat, but using maven aswell, i have this problem at the beginning were i couldnt get to the servlet, i tried putting the servlet and the servlet -mapping in the xml, but whe i run it on the server i got an error, then i deleted what i put in the xml, saved, and then run it normally, after it i tried to get to the servlet and it worked..., so, to make sure it worked, i put more responses on it, but i wasnt gettig the new responses, even when i did what i did in the xml, any solution?

  • @nikkuzmich5378
    @nikkuzmich53783 жыл бұрын

    You helped me a lot. Thank you!

  • @syedidrees6220
    @syedidrees62204 жыл бұрын

    Thank you sir very well explain you make it very easy to learn

  • @manojrana4469
    @manojrana44694 жыл бұрын

    Eclipse: Missing web.xml file? How can I create web.xml in Eclipse? DemoApp Right Click Java EE Tools Generate Deployment Descriptor Stub after that you got the web.xml file

  • @erickresurreccion5716

    @erickresurreccion5716

    3 жыл бұрын

    why i cant click generate deployment descriptor stub?

  • @dogukanteber4007

    @dogukanteber4007

    3 жыл бұрын

    thank you man

  • @amanjethaniya7011

    @amanjethaniya7011

    3 жыл бұрын

    thanks

  • @nirbhay6638

    @nirbhay6638

    3 жыл бұрын

    @@erickresurreccion5716 hey did you get how to do?

  • @aquibshaikh8611
    @aquibshaikh86113 жыл бұрын

    It says unable to resolve javax.servlet. Also while trying to add external jar the button is greyed out. This is very frustrating

  • @realhealthywater7135
    @realhealthywater71353 жыл бұрын

    Great explanation dear navin. thanks

  • @akshaysontakke3055
    @akshaysontakke30552 жыл бұрын

    Thanks you so much sir for your efforts and dedicated to teach 🔥🔥🔥🔥🔥🔥

  • @_alex_-qx3lv
    @_alex_-qx3lv2 жыл бұрын

    hi.. Navin sir.. thanks a lot for your wonderful videos. I have been following you quite a lot. But I do have some problems in mycode, just like you, I used the PrintWriter object to print the result in the browser, but for some reason, it is not printing out anything on the browser. However, it prints in the console. It didn't work even after I used the flush method. So, please help me out figure the mistakes, if i did any. Thanks and looking forward to hearing from you soon.

  • @Jethuri
    @Jethuri5 жыл бұрын

    i am getting the error... The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. i have tried all the possible solutions.. but still getting the Error Please help..

  • @jayeshkhosla5710

    @jayeshkhosla5710

    5 жыл бұрын

    Problem solved: Edit your url-pattern "/***" to exact keyword what it is, if it is case sensitive.

  • @sushmithar9343

    @sushmithar9343

    4 жыл бұрын

    @@jayeshkhosla5710 sorry i can't get you

  • @sagarmeena0210
    @sagarmeena02105 жыл бұрын

    you make it everything easy

  • @vaayuo
    @vaayuo5 жыл бұрын

    Thanks, that helped a lot!

  • @sumanjogi614
    @sumanjogi6143 жыл бұрын

    It is very helpful....thank u very very much!!!

  • @Nani-gi3ef
    @Nani-gi3ef Жыл бұрын

    Iam always Thanking You Sir❤

  • @premlatakumari91
    @premlatakumari91 Жыл бұрын

    If HttpServlet is an inteface then why we are extending it we should impliment it but rater than using impliment key we are using extends keyword reason behind it?

  • @techbuddy1519
    @techbuddy15195 жыл бұрын

    hey can you tell me why internal browser is desabled in eclipse .by the way i am using ubuntu.please solve my issue

  • @rupeshmahajan1667
    @rupeshmahajan16675 жыл бұрын

    How we can call service with multiple url , like I want same functionality with different url. Ex. /add and /service/V2/add

  • @arun1993apr
    @arun1993apr6 жыл бұрын

    i'm getting http status 500 what to do sir?? the output is also not displaying in console......

  • @amitrathod1134

    @amitrathod1134

    3 жыл бұрын

    It is an Internal Server Error. The reason for that can be your server is not yet started or not properly configured.

  • @ReinaldoAlves_Alves
    @ReinaldoAlves_Alves3 жыл бұрын

    thank you so much, bro. It helped me a lot

  • @swethasri8305
    @swethasri83053 жыл бұрын

    Can't we print the result on the same page where we gave the input?If yes, then how?

  • @simbol5638
    @simbol56385 жыл бұрын

    Great Lecture sir!

  • @heenakshiazad8167
    @heenakshiazad81675 жыл бұрын

    i m facing class not found exception on this code . Please tell me how to resolve it .

  • @sathishkumarr7106
    @sathishkumarr71064 жыл бұрын

    Keep teaching bro❤️🙂

  • @geesslight18
    @geesslight183 жыл бұрын

    sir, thank you for your great tutorial

  • @girirajsekar9951
    @girirajsekar99515 жыл бұрын

    Thankyou sir its really awesome.

  • @jkye_314
    @jkye_3144 жыл бұрын

    you are the best one !

  • @ashwinpai8195
    @ashwinpai81952 жыл бұрын

    I am still getting error in web.xml page It says 'The Value of 2.5 of attribute version on element web app is not valid with respect to its type How to solve this error ?

  • @hardik_it8825
    @hardik_it88256 жыл бұрын

    i have no option of HttpServlet class extendable so what can do for it

  • @surajtopal9940
    @surajtopal99403 жыл бұрын

    so far soo good sir ji , thanks a lot

  • @priyankau1982
    @priyankau19823 жыл бұрын

    Amazing tutorial helped a lot

  • @darshangaikwad8626
    @darshangaikwad86263 жыл бұрын

    Sir You're awesome ❤️

  • @blaxminarayanpatra7311
    @blaxminarayanpatra73116 жыл бұрын

    sir i got a exception like com.telusko.AddServlet cannot be cast to javax.servlet.Servlet

  • @sangeting
    @sangeting4 жыл бұрын

    Can you please help me with the problem i am facing. After writing all exactly as told in the tutorial web.xml is creating the error if I give the name under url pattern exactly as in html files action. the error i get is: "starting Tomcat V9.0 server at localhost has encountered a problem. Tomcat V9.0 server at localhost failed to start"

  • @wholeegg

    @wholeegg

    4 жыл бұрын

    use /add in the HTML file you created

  • @krishnendughosh2368
    @krishnendughosh23683 жыл бұрын

    When I am refreshing it is not taking me to the index page...it is staying on the same page with that addition output...any idea how to fix it???

  • @AzadariUpdates14
    @AzadariUpdates146 жыл бұрын

    Sir please share the complete playlist of java networking too.

  • @mirnagama2281
    @mirnagama22814 жыл бұрын

    My project doesn't have this web.xml file. I tried to created by myself but it's full of errors

  • @surbhimahajan5578
    @surbhimahajan55785 жыл бұрын

    Why it doesn't work when we don't do web.xml code here and write instead?

  • @tejaswibhargava8745

    @tejaswibhargava8745

    4 жыл бұрын

    for that, you need to select version 2.5 while creating the dynamic web app so it will automatically generate the .XML file and later you can use the tag

  • @DeepShahmusic
    @DeepShahmusic3 жыл бұрын

    Sir instead of javax .... Eclipse showing Jakarta And showing warning as Javax can not be resolved .... Can u please tell any solution to this?

  • @amithsai222
    @amithsai2224 жыл бұрын

    Sir can you please help me I am getting "Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase this warning" sir.. 🙏🙏🙏

  • @JyotiSingh-vs2eu
    @JyotiSingh-vs2eu5 жыл бұрын

    hllo sir program run krne pe numberformatexception aa rha h on firefox browser why ??

  • @sushantkadam4104
    @sushantkadam41043 жыл бұрын

    sir when i use com.myname.AddServlet in tag in web.xml my apache server is giving error...its showing localhost failed to start..when i use only AddServlet server starts without any problem. and after using only AddServlet its showing Error instantiating servlet class...so how can i use com.myname.AddServlet and start the server withour any problem plz help.

  • @Nani-gi3ef
    @Nani-gi3ef Жыл бұрын

    Really you are so amazing sir

  • @yashtibrewal4259
    @yashtibrewal42595 жыл бұрын

    boss httpservlet is not there, and if I try to add a jar from outside then the annotation part doesn't work... please help

  • @komalkungwani8171
    @komalkungwani81715 жыл бұрын

    great tutorial sir, I request you to provide the source code you are writing.

  • @charanimora2436
    @charanimora24363 жыл бұрын

    hi naveenwhat is that "abc" in servlet name tag it isnot mentioned anywhere othrthan that servlet name tag

  • @pallavideokate
    @pallavideokate5 жыл бұрын

    Instead of taking server rather than class how can we write program with servlet

  • @sridevipusala8970
    @sridevipusala89704 жыл бұрын

    i didnt get web.xml file in my eclipse environment . what should i do?

  • @princekumar4801
    @princekumar48013 жыл бұрын

    The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. plss help ,me why i m getting error

  • @BibekGhoshh1
    @BibekGhoshh12 жыл бұрын

    lots of love sir

  • @KIRTIMISHRA-p7o
    @KIRTIMISHRA-p7o5 күн бұрын

    Even after mapping in web.xml file, it is not jumping into next page to show output, it is just showing 404 error after clicking in submit button

  • @barracudochka
    @barracudochka6 жыл бұрын

    What exactly do we have to put in web-app config?Is it based on which version of tomcat we use?

  • @leonelnascimento5078

    @leonelnascimento5078

    6 жыл бұрын

    There you just map the servlets to call with each request...

Келесі