alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
"); //@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>"); } }

Other Java examples (source code examples)

Here is a short list of links related to this Java TemperatureTableServlet.java source code file:

Java example source code file (TemperatureTableServlet.java)

This example Java source code file (TemperatureTableServlet.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

align\=right, bgcolor, border, canada, cccccc, celsius, cols\=2, fahrenheit, ffff00, httpservlet, printstream, table, temperaturetableservlet, util, width

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 11 out.println(""); //@line 12 out.println("<table BORDER COLS=2 WIDTH=\"20%\" >"); //@line 13 out.println("<tr BGCOLOR=\"#FFFF00\">"); //@line 14 out.println("<th>Fahrenheit"); //@line 15 out.println("<th>Celsius"); //@line 16 out.println("</tr>"); //@line 17 out.println(""); //@line 18 for (int i = 0; i <= 100; i += 10) { //@line 19 out.println("<tr ALIGN=RIGHT BGCOLOR=\"#CCCCCC\">"); //@line 20 out.println("<td>" + i + "
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.