net.sourceforge.ajaxtags.demo.servlet
Class AutocompleteServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by net.sourceforge.ajaxtags.servlets.BaseAjaxServlet
          extended by net.sourceforge.ajaxtags.demo.servlet.AutocompleteServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, BaseAjaxXmlAction

public class AutocompleteServlet
extends BaseAjaxServlet

An example servlet that responds to an ajax:autocomplete tag action. This servlet would be referenced by the baseUrl attribute of the JSP tag.

This servlet should generate XML in the following format:

 <![CDATA[<?xml version="1.0"?>
 <list>
   <item value="Item1">First Item</item>
   <item value="Item2">Second Item</item>
   <item value="Item3">Third Item</item>
 </list>]]>
 

Version:
$Revision: 28 $ $Date: 2008-11-09 23:12:33 +0100 (So, 09. Nov 2008) $
Author:
Darren L. Spurgeon
See Also:
Serialized Form

Constructor Summary
AutocompleteServlet()
           
 
Method Summary
 String getXmlContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Each child class should override this method to generate the specific XML content necessary for each AJAX action.
 
Methods inherited from class net.sourceforge.ajaxtags.servlets.BaseAjaxServlet
getServletInfo, getXMLEncoding, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, 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

AutocompleteServlet

public AutocompleteServlet()
Method Detail

getXmlContent

public String getXmlContent(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws javax.servlet.ServletException,
                            IOException
Description copied from interface: BaseAjaxXmlAction
Each child class should override this method to generate the specific XML content necessary for each AJAX action.

Parameters:
request - the HttpServletRequest object
response - the HttpServletResponse object
Returns:
a String representation of the XML response/content
Throws:
javax.servlet.ServletException - any errors
IOException - any IO error
See Also:
BaseAjaxXmlAction.getXmlContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)


Copyright © 2005-2010 The Ajaxtags Team. All Rights Reserved.