/** * Projekt: gregsINFO * Package: utils * * @author: Gregor Scheithauer http://www.gregs.info * @version: 1.0 * Description: * Java Servlet Version of 99 bottles of Beer on the wall | 2004 */ package utils; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; public class BottlesOfBeer extends HttpServlet { protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter write = response.getWriter(); write.println( "\n\t
"); write.print("take one down, pass it around, "); write.println( (bottles - 1) + " bottle" + s + " of beer on the wall."); write.println("
"); } else { write.println(""); write.print("go to the store, buy some more, "); write.println("99 bottles of beer on the wall."); write.println("
"); } } write.println("\t"); write.println(""); } }