Development and deployment of J2EE applications are different than java standalone applications.
Simplest Shortest Sweetest Servlet tutorial – Part 1 will tell you about basic concept of servlet. And will remove your fear to build any J2EE application
Sample Java Servlet for your reference has sample code for your reference purpose.
But now you need to know practically how to develop a servlet based J2EE application. Although it is possible to develop all the code with only JDK but I’ll suggest to use some IDE like Eclipse or NetBeans.
Watch below shortest servlet video tutorial….(Eclipse)
Servlet development using Eclipse and Tomcat
If you want to switch from Eclipse to Netbeans or vice versa refer below articles;
How to import NetBeans project into Eclipse