Quickstart JSP/Servlets Demo using NetBeans
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.
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.
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.
Go for it! And, I see your point about mapping the class to the URL mapping. Looking forward to more demos!
Very nice! Yeah, go for it (more demos).
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!!!!!
anu, I am glad you liked the demo and found it interesting. Good luck with learning servlets.
Hi, do you know where I can download for free the ebook or pdf of head first servlets and jsp?
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!
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….
A clear and concise demo, I enjoyed it indeed
Thank you
Thats awesome, I thought servlets were very difficult and combersome before I saw this demo. You make simple and clear. Well done.
thanks very much for this video it did really helped me :).
Awesome demo. This was very helpful for me.
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
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!