import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** * This is a simple example of an HTTP Servlet. It responds to the GET * and HEAD methods of the HTTP protocol. */ public class TestX10 extends HttpServlet { rs485 rs = rs485.getInstance(); /** * Handle the GET and HEAD methods by building a simple web page. * HEAD is just like GET, except that the server returns only the * headers (including content length) not the body we write. */ public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out; String title = "Test X10 servlet"; // set content type and other response header fields first response.setContentType("text/html"); // then write the data of the response out = response.getWriter(); // get the test choice String choice = request.getParameter("choice"); int temp = 0; if (choice.equals("Front Lights On")) temp = 2; else if (choice.equals("Front Lights Off")) temp = 20; else if (choice.equals("Buzzer1 On")) temp = 4; else if (choice.equals("Buzzer2 On")) temp = 5; else if (choice.equals("Sprinkler On")) temp = 6; else if (choice.equals("Sprinkler Off")) temp = 60; else if (choice.equals("RetirementLights On")) temp = 7; else if (choice.equals("RetirementLights Off")) temp = 70; rs.sendX10(temp); out.println("