Order the Book

coreservlets
Class BadCodeServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--coreservlets.BadCodeServlet
Direct Known Subclasses:
FilteredCodeServlet

public class BadCodeServlet
extends HttpServlet

Servlet that displays a fragment of some Java code, but forgets to filter out the HTML-specific characters (the less-than sign in this case).

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.

See Also:
Serialized Form

Constructor Summary
BadCodeServlet()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
           
 String getCodeFragment()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BadCodeServlet

public BadCodeServlet()
Method Detail

getCodeFragment

public String getCodeFragment()

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  IOException
Overrides:
doGet in class HttpServlet

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive