FileDocCategorySizeDatePackage
SpecialGetter.javaAPI DocExample806Thu Apr 05 20:19:34 BST 2001None

SpecialGetter

public class SpecialGetter extends HttpServlet

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)

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

    ServletContext context = getServletContext();
    String burrito = (String)
      context.getAttribute("com.costena.special.burrito");
    Date day = (Date)
      context.getAttribute("com.costena.special.day");

    DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
    String today = df.format(day);

    out.println("Our burrito special today (" + today + ") is: " + burrito);