package servlet; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; /** *

Title: Esimerkkejä servleteistä

*

Description: Esimerkki alasvetolistasta

*

Copyright: Copyright (c) 2004

*

Company: jyu

* @author Vesa Lappalainen * @version 1.0 */ public class ServletValinta extends HttpServlet { private static final long serialVersionUID = 1L; private static final String CONTENT_TYPE = "text/html"; //Initialize global variables public void init() throws ServletException { } //Process the HTTP Get request public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String valinta = request.getParameter("valinta"); if (valinta == null) { valinta = ""; } response.setContentType(CONTENT_TYPE); PrintWriter out = response.getWriter(); out.println(""); out.println("ServletValinta"); out.println(""); out.println("

Valinta = " + valinta + "

"); out.println("
"); out.println("

Mikä on kiva eläin "); out.println(""); out.println("

"); out.println("

Valitse ja paina Lähetä

"); out.println("

"); out.println("

"); out.println(""); } //Clean up resources public void destroy() { } }