Class 2 |
Intermediate Java 30-IT-397 |
|
Lab Time
-
Expand on my calculator example. Start with that code if you wish,
or start with the JSP templates provided in NetBeans.
-
Using scriptlets, make a simple calculator that will accept two numbers
and add, divide, subtract, or multiply them, or raise one number to the
power of another.
-
Import any necessary packages using <%@ page import="package
name" %>.
-
Make a static HTML page with a form. The form should have text boxes
for the first number, second number, and mathematical operation.
When the user clicks the submit button, the form should call this JSP.
-
Use error.jsp, or your own error page, to handle exceptions. You
can use a try - catch block for parts if you'd like, but you should try
using an error JSP as well.
-
If you have time, keep playing around with it.
-
You can use the Tomcat edition in NetBeans by right-clicking on the file
and then selection either Execute or Execute (force reload).
-
Need help? Please ask.

Created by: Brandan Jones
December 20, 2001