Ease of using NetBeans

April 7, 2008 · Uncategorized

NetBeans is a great Open Source utility and a one-stop-shop for all your Java, JSP, Servlet development and testing needs. Its certainly reduces a lot of the development time and its a very easy tool to test any kind of web based application. Here are some basic steps to create a project file and deploy a web-based application written in JSP and using a servlet.

1. Creating a new Project in netbeans

a. Click on files, choose newproject, choose web application, click next, fill the project name, click next, choose Java ServerFaces and click finish.

2. Creating a new jsp file

a. Click on files, select new file, select jsp , click next, give filename with out extention, click finish
b. chose that jsp file from new project /webpages folder
c. add the code there and save the jsp file

3. Creating a servlet file

a. Click on files select new file, select servlet , click next, give filename with out extention, click finish
b. Chose that jsp file from new project / source packages folder
c. Add code there and save.

4. How to Run the jsp page

a. Choose the jsp file in file viewer in netbeans and go to run -> run main project button . It opens an internet explorer and shows the http://localhost path there after that add the file name.jsp and click enter. It displays the result of the jsp file and automatically runs the servlet while clicking the submit button.