95-702 Distributed Systems
Getting Started
===============
Installation Lab
================
This lab is not to be turned in but needs to be completed
as soon as possible. Contact your instructor or the TA if you are
having difficulties.
Part 1 Download and test.
=========================
0. Download and install the most recent version of
Netbeans from http://www.netbeans.org/downloads/index.html.
Choose the largest bundle.
If you have Oracle running you will need to change two port
values in the config/domain.xml. Change 8080 to 6502 and
8181 to 6503.
1. Publish a simple Java Server Page (JSP).
Create a Netbeans project called SuperSimpleJSPProject.
Select the category as Java Web and the Project as Web Application.
Enter this document in the editor. Call it index.jsp. Test
it in a browser.
<% java.util.Date d = new java.util.Date(); %>
Today is <%= d.toString() %>
Part 2 Test a servlet and an index.jsp page.
============================================
0. Provide the HTML in a JSP page.
In a new project, enter this document as index.jsp:
Introductions
1. Create a servlet and give it the name HandleForm. Give it
the URL pattern /ProcessForm.
When doing this step, be sure that the "Add Information to Deployment
Descriptor" check box is checked.
HandleForm.java is invoked by Glassfish when an HTTP
request arrives.
// HandleForm.java
// An introductory servlet
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class HandleForm extends HttpServlet{
public void doGet(HttpServletRequest req,
HttpServletResponse response)
throws ServletException,
IOException {
String personName = req.getParameter("personName");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String docType = "\n";
out.println(docType +
"\n" +
"Hi" + personName + "\n" +
"\n" +
" Hi"+ personName + "
\n" +
"");
}
}
Part 3 Download and test Android
================================
0. Download the Android SDK from here.
http://developer.android.com/sdk/index.html
1. The Android hello world is here.
http://developer.android.com/resources/tutorials/hello-world.html