|
Java example source code file (TemperatureTableServlet.java)
The TemperatureTableServlet.java Java example source code
//@file TemperatureTable.jsp /nodynamiccopyright/ hard coded linenumbers in other tests - DO NOT CHANGE
import java.io.*;
import java.util.*;
// import javax.servlet.*;
// import javax.servlet.http.*;
public class TemperatureTableServlet /* extends HttpServlet */{
public static void main(String[] args) {
// public void doGet(HttpServletRequest request, HttpServletResponse response)
// throws IOException, ServletException {
HelloWorld.main(args); // so we can we non-JSP code too
PrintStream out = System.out;
// response.setContentType("text/html");
// PrintWriter out = response.getWriter();
//@line 1
out.println("<html>");
//@line 2
out.println("<head>");
//@line 3
out.println(" <title>Temperature Table");
//@line 4
out.println("</head>");
//@line 5
out.println("<body>");
//@line 6
out.println("");
//@line 7
out.println("<h1>Temperature Table");
//@line 8
out.println("<p>American tourists visiting Canada can use this handy temperature");
//@line 9
out.println("table which converts from Fahrenheit to Celsius:");
//@line 10
out.println("<br> | ");
//@line 21
out.println("<td>" + ((i - 32) * 5 / 9) + "");
//@line 22
out.println("</tr>");
//@line 23
}
//@line 24
out.println("");
//@line 25
out.println("</table>");
//@line 26
out.println("<p>Created " + new Date () + "");
//@line 27
out.println("");
//@line 28
out.println("</body>");
//@line 29
out.println("</html>");
}
}
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.