Start up netBeans

foreheadsobstinacySoftware and s/w Development

Aug 15, 2012 (5 years ago)

243 views

Start up
netBeans




Create a new
project


Create a new web project









Make Sure the project is deployed on the server by going to tomcat and seeing the web
applications deployed on it. If you webapp is not on tomcat then right click on the pro
ject
and click on deploy.




Create your html file and run it on the server. This is explained in the diagram below :






Now that you’ve set up netBeans let’s write our servlet and deploy it to Tomcat


In order to do this you have to write a servlet.
If you do not know about servlets you can
read my tutorial on servlets (I’ll write one if needed). netBeans organizes its Java Classes
under Source Packages.




In order to keep your classes well organized create different folders for a group of related
c
lasses. For instance, for all your servlets create a package named
servlets or for all your
login functionality create a package named login and so forth ...





Under this package create a new servlet








If you create the servlet this way, netBe
ans will automatically edit the web.xml file and
add the servlet mapping to it.




Congratulations you’ve written your first servlet !!!


Now all you’ve got to do is modify this servlet to take in your requests. I have attached to
servet below :