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

Sdílet
Vložit
  • čas přidán 5. 08. 2024
  • 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 : czcams.com/channels/xmk.html...
    Telusko Hindi :
    czcams.com/channels/itz.html...
    Donation:
    PayPal Id : navinreddy20
    Patreon : navinreddy20
    www.telusko.com/contactus
  • Věda a technologie

Komentáře • 366

  • @omaralkhalisi4354
    @omaralkhalisi4354 Před 5 lety +18

    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
    @varunreddy9806 Před 2 lety +8

    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
    @shashikalaraju5769 Před 4 lety +25

    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
    @kakaoringo0929 Před 4 lety +12

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

  • @techmoon_
    @techmoon_ Před 2 lety

    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-fe8zn Před 4 lety +1

    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. CZcamsr like you and other are making a good software developer who has good concepts of the subject. love you sir....♥️♥️♥️♥️

  • @starman9000
    @starman9000 Před 3 lety +1

    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.

  • @chiranjeetparida263
    @chiranjeetparida263 Před 4 lety +2

    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 Před rokem +2

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

  • @jamestran1719
    @jamestran1719 Před 6 lety +1

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

  • @lodashnotebook5390
    @lodashnotebook5390 Před 4 lety +4

    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!

  • @dharmang
    @dharmang Před 4 lety

    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 😂

  • @poladalqayev631
    @poladalqayev631 Před 6 lety

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

  • @thedrunkmonk8386
    @thedrunkmonk8386 Před 4 lety

    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
    @shoebkhan1503 Před 4 lety +3

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

    • @lodashnotebook5390
      @lodashnotebook5390 Před 4 lety +1

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

  • @hanishvenkat9496
    @hanishvenkat9496 Před 8 měsíci

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

  • @ankitaB11
    @ankitaB11 Před 2 lety +1

    This is hands down the best. End of story

  • @RoguePow
    @RoguePow Před 5 lety

    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?

  • @Scholarly_Stories
    @Scholarly_Stories Před 2 lety +1

    i was struglling for last 4 hrs, finally tqqqqqqqq

  • @stursshiphez7559
    @stursshiphez7559 Před 3 lety +6

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

  • @akshayn7687
    @akshayn7687 Před 2 lety

    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😍👍🏻

  • @nc840
    @nc840 Před 3 lety +2

    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 :)

  • @thiago670
    @thiago670 Před 6 lety +1

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

  • @berkercin6800
    @berkercin6800 Před 5 lety +1

    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?

  • @domb3665
    @domb3665 Před 5 lety

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

  • @tusharadhatrao4749
    @tusharadhatrao4749 Před 3 lety

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

  • @venpolis8258
    @venpolis8258 Před 6 lety +1

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

  • @chinli72
    @chinli72 Před 2 lety

    Best video on servlet, simple and clear.

  • @dhananjaygohil1527
    @dhananjaygohil1527 Před 5 lety +1

    You are a very good teacher sir.

  • @arpita0608
    @arpita0608 Před 5 lety +1

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

  • @xyzabc6898
    @xyzabc6898 Před 3 lety

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

  • @ashwanipanchal7467
    @ashwanipanchal7467 Před 6 lety +1

    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.

  • @arunagirim3455
    @arunagirim3455 Před 3 lety +2

    its coming error while importing java servlet.http.HttpServlet can anyone help me

  • @dhirajshalgar5015
    @dhirajshalgar5015 Před 3 lety +2

    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 Před 2 lety

      Have you resolved it?

  • @digitalcity3153
    @digitalcity3153 Před 5 lety

    Wow.... your Explanation is great sir

  • @bharathirv8479
    @bharathirv8479 Před 5 lety +1

    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.

  • @maveone2
    @maveone2 Před 6 lety +1

    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?

  • @sunnyparmar9692
    @sunnyparmar9692 Před 5 lety

    This was a very helpful video indeed.. thank you

  • @chandranihalder8713
    @chandranihalder8713 Před 6 lety +1

    Awesome tutorial, thanks!

  • @swordrohit07
    @swordrohit07 Před 3 lety +1

    very clear explanation ..great tutorial

  • @junaidansari95
    @junaidansari95 Před 6 lety +8

    Super tutorials by superman! Lol

  • @MuhammadUsman-ke1sl
    @MuhammadUsman-ke1sl Před 3 lety

    Excellent Content, well explained, well programmed

  • @sunnyjain630
    @sunnyjain630 Před 4 lety

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

  • @p9bklokendrabhajane255

    Awesome channel for me .
    Salute to you Sir..

  • @aastha4708
    @aastha4708 Před 3 lety

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

  • @tejaswibhargava8745
    @tejaswibhargava8745 Před 4 lety +1

    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()

  • @realhealthywater7135
    @realhealthywater7135 Před 3 lety

    Great explanation dear navin. thanks

  • @nikkuzmich5378
    @nikkuzmich5378 Před 3 lety

    You helped me a lot. Thank you!

  • @rusnardo17
    @rusnardo17 Před 3 lety

    Thank you very much, very well explained.

  • @shailjakantupadhyay5183

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

  • @anjupanicker7934
    @anjupanicker7934 Před 3 lety

    Jeez Thanks a lot I owe my life to this vid

  • @gopalbharadva9623
    @gopalbharadva9623 Před 5 lety +1

    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

  • @muthulakshmiram7622
    @muthulakshmiram7622 Před 2 lety

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

  • @prathamchitransh5338
    @prathamchitransh5338 Před 2 lety +1

    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?

  • @premlatakumari91
    @premlatakumari91 Před rokem

    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?

  • @simbol5638
    @simbol5638 Před 5 lety

    Great Lecture sir!

  • @revanthreddy1906
    @revanthreddy1906 Před 4 lety +4

    HTTP status 500 - internal Server error
    How to resolve this error

    • @ganivicky8383
      @ganivicky8383 Před 4 lety

      Did you found that error solution... If you got the solution then pls help me..

    • @revanthreddy1906
      @revanthreddy1906 Před 4 lety

      @@ganivicky8383 no i did not get!

    • @GeloEd
      @GeloEd Před 3 lety

      Resolved my error 500. Paste the error here. i could help.

  • @syedidrees6220
    @syedidrees6220 Před 4 lety

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

  • @aquibshaikh8611
    @aquibshaikh8611 Před 3 lety +1

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

  • @sathishkumarr7106
    @sathishkumarr7106 Před 4 lety +1

    Keep teaching bro❤️🙂

  • @vaayuo
    @vaayuo Před 5 lety

    Thanks, that helped a lot!

  • @Nani-gi3ef
    @Nani-gi3ef Před rokem

    Iam always Thanking You Sir❤

  • @akshaysontakke3055
    @akshaysontakke3055 Před 2 lety

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

  • @surajtopal9940
    @surajtopal9940 Před 3 lety

    so far soo good sir ji , thanks a lot

  • @sumanjogi614
    @sumanjogi614 Před 3 lety +1

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

  • @Nani-gi3ef
    @Nani-gi3ef Před rokem

    Really you are so amazing sir

  • @priyankau1982
    @priyankau1982 Před 3 lety

    Amazing tutorial helped a lot

  • @manojrana4469
    @manojrana4469 Před 4 lety +8

    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

  • @techbuddy1519
    @techbuddy1519 Před 5 lety

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

  • @geesslight18
    @geesslight18 Před 3 lety

    sir,
    thank you for your great tutorial

  • @darshangaikwad8626
    @darshangaikwad8626 Před 3 lety +1

    Sir You're awesome ❤️

  • @Jethuri
    @Jethuri Před 5 lety +8

    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 Před 5 lety

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

    • @sushmithar9343
      @sushmithar9343 Před 5 lety

      @@jayeshkhosla5710 sorry i can't get you

  • @girirajsekar9951
    @girirajsekar9951 Před 5 lety

    Thankyou sir its really awesome.

  • @BibekGhoshh1
    @BibekGhoshh1 Před 2 lety +1

    lots of love sir

  • @ReinaldoAlves_Alves
    @ReinaldoAlves_Alves Před 3 lety

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

  • @blaxminarayanpatra7311

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

  • @sushantkadam4104
    @sushantkadam4104 Před 3 lety

    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.

  • @jkye_314
    @jkye_314 Před 4 lety

    you are the best one !

  • @maddydllng2882
    @maddydllng2882 Před 5 lety +1

    superb sir.....

  • @yashtibrewal4259
    @yashtibrewal4259 Před 5 lety

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

  • @heenakshiazad8167
    @heenakshiazad8167 Před 5 lety +1

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

  • @rupeshmahajan1667
    @rupeshmahajan1667 Před 5 lety

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

  • @princekumar4801
    @princekumar4801 Před 3 lety

    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

  • @sreelakshmiks292
    @sreelakshmiks292 Před 5 lety +1

    Very helpful🤗

  • @DeepShahmusic
    @DeepShahmusic Před 3 lety

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

  • @hardik_it8825
    @hardik_it8825 Před 6 lety

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

  • @jaivinmovaliya5827
    @jaivinmovaliya5827 Před 5 lety

    Amazing teaching

  • @sridevipusala8970
    @sridevipusala8970 Před 4 lety

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

  • @sagarmeena0210
    @sagarmeena0210 Před 5 lety +8

    you make it everything easy

  • @krishnendughosh2368
    @krishnendughosh2368 Před 3 lety

    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???

  • @amithsai222
    @amithsai222 Před 4 lety

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

  • @priyadharshinis8971
    @priyadharshinis8971 Před 2 lety

    Hello sir,
    In my project explorer java resource file is not shown, how to add that? Could you plz help me sir

  • @mirnagama2281
    @mirnagama2281 Před 4 lety

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

  • @arun1993apr
    @arun1993apr Před 6 lety +12

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

    • @amitrathod1134
      @amitrathod1134 Před 3 lety

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

  • @rashijain4207
    @rashijain4207 Před 6 lety

    Superb tutorials

  • @preethamm.n1161
    @preethamm.n1161 Před 4 lety

    💞💞💞Awesome sir
    I love servlets 🌹💞💞💞

  • @sangeting
    @sangeting Před 4 lety +2

    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 Před 4 lety

      use /add in the HTML file you created

  • @surbhimahajan5578
    @surbhimahajan5578 Před 5 lety +1

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

    • @tejaswibhargava8745
      @tejaswibhargava8745 Před 4 lety

      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

  • @top5things968
    @top5things968 Před rokem

    Thank you sir !

  • @ashwinpai8195
    @ashwinpai8195 Před 2 lety

    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 ?