FileDocCategorySizeDatePackage
ColorCustServlet.javaAPI DocExample744Thu Jun 08 14:57:04 BST 2000None

ColorCustServlet

public class ColorCustServlet extends HttpServlet
Color customization servlet

Fields Summary
protected static final String
DEFAULT_COLOR
protected String
faveColor
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)


	     
	  
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();

		String cand=request.getParameter("color_name");
		if (cand != null) {
			faveColor = cand;
			Cookie c = new Cookie(CookieServlet.PREFS_BGCOLOR, faveColor);
			c.setMaxAge(60*60*24*365);
			response.addCookie(c);
		}
		response.sendRedirect("/servlet/CookieServlet");