Order the Book

Class FilteredCodeServlet


public class FilteredCodeServlet
extends BadCodeServlet

Subclass of BadCodeServlet that keeps the same doGet method but filters the code fragment for HTML-specific characters. You should filter strings that are likely to contain special characters (like program excerpts) or strings that are derived from user input.

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
Method Summary
 String getCodeFragment()
Methods inherited from class coreservlets.BadCodeServlet
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


public FilteredCodeServlet()
Method Detail


public String getCodeFragment()
getCodeFragment in class BadCodeServlet

Order the Book

CSAJSP @ amazon.com

Return to Top-Level Source Code Archive