Exercise 3-1 Install and use the NetBeans IDE This exercise makes sure that you can use NetBeans to run a web application on a Tomcat server. Test NetBeans and Tomcat 1. Create a new project for a web application named testApp, and save it in the ex_starts directory. 2. Make sure this project uses the Tomcat server. 3. Use the Projects window to review the folders and files for the testApp project. Run the testApp web application, and review the information that's in the NetBeans Output window. 4. Add a JSP file to the project Add a JSP file named test.jsp to the project. 5. 6. Edit the code for the test.jsp file so it includes this tag within its body tags: Test JSP To do that, type an opening bracket (<), select the h2 tag from the resulting list, and press the Enter key. Next, press the Enter key again to complete the tag, and type "Test JSP" within the tag. 7. Right-click on the test.jsp file in the Projects window, and select the Run File command to display this JSP in a browser. 8. Use the Window>IDE Tools>Palette command to open the Palette window, and click on the plus signs for HTML, HTML Forms, and JSP to expand these items. Then, drag the Text Input item to the test.jsp file right after the h2 tag that you just entered. In the dialog box that opens, type testName for the Name and click on the OK button. Note the HTML tags that are added to the JSP.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Exercise 3-1
Install and use the NetBeans IDE
This exercise makes sure that you can use NetBeans to run a web application on
a Tomcat server.
Test NetBeans and Tomcat
Create a new project for a web application named testApp, and save it in the
ex_starts directory.
1.
2. Make sure this project uses the Tomcat server.
3.
Use the Projects window to review the folders and files for the testApp project.
Run the testApp web application, and review the information that's in the
NetBeans Output window.
4.
Add a JSP file to the project
Add a JSP file named test.jsp to the project.
5.
6. Edit the code for the test.jsp file so it includes this tag within its body tags:
<h2>Test JSP</h2>
To do that, type an opening bracket (<), select the h2 tag from the resulting
list, and press the Enter key. Next, press the Enter key again to complete the
tag, and type "Test JSP" within the tag.
7. Right-click on the test.jsp file in the Projects window, and select the Run File
command to display this JSP in a browser.
8. Use the Window>IDE Tools>Palette command to open the Palette window,
and click on the plus signs for HTML, HTML Forms, and JSP to expand
these items. Then, drag the Text Input item to the test.jsp file right after the h2
tag that you just entered. In the dialog box that opens, type testName for the
Name and click on the OK button. Note the HTML tags that are added to the
JSP.
Transcribed Image Text:Exercise 3-1 Install and use the NetBeans IDE This exercise makes sure that you can use NetBeans to run a web application on a Tomcat server. Test NetBeans and Tomcat Create a new project for a web application named testApp, and save it in the ex_starts directory. 1. 2. Make sure this project uses the Tomcat server. 3. Use the Projects window to review the folders and files for the testApp project. Run the testApp web application, and review the information that's in the NetBeans Output window. 4. Add a JSP file to the project Add a JSP file named test.jsp to the project. 5. 6. Edit the code for the test.jsp file so it includes this tag within its body tags: <h2>Test JSP</h2> To do that, type an opening bracket (<), select the h2 tag from the resulting list, and press the Enter key. Next, press the Enter key again to complete the tag, and type "Test JSP" within the tag. 7. Right-click on the test.jsp file in the Projects window, and select the Run File command to display this JSP in a browser. 8. Use the Window>IDE Tools>Palette command to open the Palette window, and click on the plus signs for HTML, HTML Forms, and JSP to expand these items. Then, drag the Text Input item to the test.jsp file right after the h2 tag that you just entered. In the dialog box that opens, type testName for the Name and click on the OK button. Note the HTML tags that are added to the JSP.
84
Section 1
Get started right
9.
JSP in a browser.
instead of the test.jsp file, which is usually what you want.
Add a servlet file to the project
11. Add a Java servlet named TestServlet to a package named murach.test, and
map it to the /test URL.
12. In the editor window, scroll to the bottom of the TestServlet file and click on
the + sign before the HttpServlet methods. That should expand the starting
code for these methods. Then, note that the doGet and doPost methods call
the processRequest method that's earlier in the servlet. You'll learn how to
code the doGet and doPost methods of a servlet in chapter 5.
13. In the Projects window, right-click on the TestServlet file and select the Run
File command. In the resulting dialog box, click OK. At this point, NetBeans
should display a browser window with some text in it that indicates that this
servlet has executed. Note that NetBeans uses the URL that you specified in
step 11 to call the servlet.
14. Close the testApp project.
Right-click on the test.jsp file, and select the Run File to this
10. Press the F6 button to run the Note that the file runs
Transcribed Image Text:84 Section 1 Get started right 9. JSP in a browser. instead of the test.jsp file, which is usually what you want. Add a servlet file to the project 11. Add a Java servlet named TestServlet to a package named murach.test, and map it to the /test URL. 12. In the editor window, scroll to the bottom of the TestServlet file and click on the + sign before the HttpServlet methods. That should expand the starting code for these methods. Then, note that the doGet and doPost methods call the processRequest method that's earlier in the servlet. You'll learn how to code the doGet and doPost methods of a servlet in chapter 5. 13. In the Projects window, right-click on the TestServlet file and select the Run File command. In the resulting dialog box, click OK. At this point, NetBeans should display a browser window with some text in it that indicates that this servlet has executed. Note that NetBeans uses the URL that you specified in step 11 to call the servlet. 14. Close the testApp project. Right-click on the test.jsp file, and select the Run File to this 10. Press the F6 button to run the Note that the file runs
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 11 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY