Home > Demo/Tutorial, General > Quickstart JSP/Servlets Demo using NetBeans

Quickstart JSP/Servlets Demo using NetBeans

September 18th, 2005

For a project that I am doing at school I am creating a series of short little Wink tutorial/demos to help the other members in my team come up to speed with some of the technology that we are using. The first of these tutorials is a Quickstart JSP/Servlet Demo using NetBeans.

The video shows how to set up a web application, create a simple JSP page, a simple Servlet and run everything using the bundled tomcat server. The JSP page is used to pass some form data to the Servlet which then prints it to the browser. The whole thing is a little large at just over 9 megs, so be patient. Although it does not take all that long to download on my DSL connection.

Categories: Demo/Tutorial, General Tags:
  1. Geertjan
    September 20th, 2005 at 00:32 | #1

    Really cool demo! By the way, don’t know if you know, but in 5.0 you’ll be able to drag-and-drop a code snippet for the form into your JSP file. So you won’t have to do all that typing, there’ll be a dialog box that you fill in with the values and then NetBeans generates all the tags for you. I like how you showed code completion in the JSP file. I also like how you mention that NetBeans bundles everything when it deploys to Tomcat. Maybe you shouldn’t use the default package, but that’s a small thing. Finally, you indicate displeasure at the web.xml, for the way the servlet entries are done. Well, to me, in the first entry you specify the class and in the second you specify the URL-mapping. To connect them, you have to give a name. That’s all. Doesn’t seem unreasonable to me. Anyway, great demo — really good at showing what users really need to know about how simply web applications can be put together. Congrats.

  2. September 20th, 2005 at 08:20 | #2

    Wow, thank you. I am glad you liked the demo. As for the web.xml thing, if I remember correctly, in the book, Head First JSP and Servlets, Kathy Sierra and Burt mention a similar complaint. It does make sense. I just think it is overly complicated for newbies. That is all. It is one more thing that they have to learn. I don’t really see why, in the mapping section, you could not just map the URL name directly to the class.

    With comments like this, I may try my hand at a few more demos. Thanks.

  3. Geertjan
    September 20th, 2005 at 14:12 | #3

    Go for it! And, I see your point about mapping the class to the URL mapping. Looking forward to more demos!

  4. dejan
    October 5th, 2005 at 23:20 | #4

    Very nice! Yeah, go for it (more demos).

  5. anu
    July 8th, 2006 at 17:04 | #5

    i am a total newbie and was completely lost wid servlets(i take time 2 grasp)….and this demo was just wat i needed….awesome!!!
    plzz add more servlet demos!!
    luv u lotsss!!!!!

  6. July 8th, 2006 at 17:25 | #6

    anu, I am glad you liked the demo and found it interesting. Good luck with learning servlets.

  7. juan
    February 18th, 2007 at 22:23 | #7

    Hi, do you know where I can download for free the ebook or pdf of head first servlets and jsp?

  8. April 7th, 2007 at 01:54 | #8

    Hi, this tutorial is very nice. I wanted to start programming servlets and make my own CMS. I know Java pretty well but I have no clue how to install a servlet container. I didn’t know that NetBeans (which is my primary developement tool) had a container installed already.
    Thanks a lot!

  9. April 8th, 2007 at 10:52 | #9

    Hey, this is me again. I watched your video once again and I noticed the comment near end. You didn’t know why there were three names for one Servlet. I think I can explain this:
    The servlet gets three names in the “web.xml” file:

    servlet-name
    servlet-class
    url-pattern

    The web.xml file is used for finding the servlets and caling them in an appropriate way. The servlet-name is used for calling the servlet from the page. The “web.xml” file gets this information from the client and uses it to find the matching servlet. The servlet-class is a OOP thing (I think so). I think you know that there are classes in Java and that the whole language is Object oriented (which I love). The url-pattern is used for finding the file that contains the servlet.

    That’s what I suppose….

  10. John Hetherington
    July 16th, 2007 at 22:21 | #10

    A clear and concise demo, I enjoyed it indeed

  11. July 16th, 2007 at 22:38 | #11

    Thank you

  12. Emmanuel
    August 6th, 2008 at 04:20 | #12

    Thats awesome, I thought servlets were very difficult and combersome before I saw this demo. You make simple and clear. Well done.

  13. ehsan
    September 3rd, 2008 at 18:54 | #13

    thanks very much for this video it did really helped me :) .

  14. Kumuda
    September 19th, 2008 at 19:19 | #14

    Awesome demo. This was very helpful for me.

  15. September 20th, 2008 at 22:23 | #15

    fuzzylizard on July 8th, 2006
    anu, I am glad you liked the demo and found it interesting. Good luck with learning servlets.

    This is excellent demo i want same demo like this with jboss server

  16. Rick
    September 21st, 2008 at 12:56 | #16

    Thank you for the demo– i’ve done a lot of reading and had gotton thoroughly confused.. then everything came together for me in a matter of minutes thanks to your demo.. thanks again!

  17. muru
    October 30th, 2008 at 16:24 | #17

    Hi

    thank you for your demo.

    if you have JDBC connection using jsp and netbean please give the demo

    thanks in advance

  18. MOhan
    December 20th, 2008 at 16:24 | #18

    Hi
    thank you for your demo.This was very helpful for me.

  19. January 7th, 2009 at 20:08 | #19

    with the info provided here i could easily learn with very few steps which were easy to understand wit simple language and also with practical demo its makes freshers like me go grasp events immediately…………………… thank you good bye hope so we ll meet again

  20. geekmaster
    March 26th, 2009 at 09:38 | #20

    really awesome tutorial.. waiting for more of those…..

Comments are closed.