Esri Geoportal Server
1.2.9

com.esri.gpt.control.cart
Class CartServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.esri.gpt.framework.context.BaseServlet
              extended by com.esri.gpt.control.cart.CartServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class CartServlet
extends BaseServlet

Servlet end-point for a simple implementation of an item cart based upon an in-memory (i.e. session) collection of ids.

See Also:
Serialized Form

Constructor Summary
CartServlet()
           
 
Method Summary
protected  void execute(HttpServletRequest request, HttpServletResponse response, RequestContext context)
          Processes the HTTP request.
protected  String generateJsonError(HttpServletRequest request, HttpServletResponse response, RequestContext context, MessageBroker msgBroker, Throwable t)
          Generates a JSON based error object.
protected  String generateJsonInfo(HttpServletRequest request, HttpServletResponse response, RequestContext context, MessageBroker msgBroker, Cart cart, int maxItems, String warning, boolean includeKeys)
          Generates a JSON based summary object for the cart.
 
Methods inherited from class com.esri.gpt.framework.context.BaseServlet
authenticate, doGet, doPost, getCredentials, getLogger, getParameterValue, getRealm, readInputCharacters, writeCharacterResponse, writeHtmlResponse, writeXmlResponse
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, 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

CartServlet

public CartServlet()
Method Detail

execute

protected void execute(HttpServletRequest request,
                       HttpServletResponse response,
                       RequestContext context)
                throws Exception
Processes the HTTP request.

Specified by:
execute in class BaseServlet
Parameters:
request - the HTTP request
response - HTTP response
context - request context
Throws:
Exception - if an exception occurs

generateJsonError

protected String generateJsonError(HttpServletRequest request,
                                   HttpServletResponse response,
                                   RequestContext context,
                                   MessageBroker msgBroker,
                                   Throwable t)
Generates a JSON based error object.

Parameters:
request - the HTTP servlet request
response - the HTTP servlet response
context - the request context
msgBroker - the message broker
t - the exception
Returns:
the JSON string

generateJsonInfo

protected String generateJsonInfo(HttpServletRequest request,
                                  HttpServletResponse response,
                                  RequestContext context,
                                  MessageBroker msgBroker,
                                  Cart cart,
                                  int maxItems,
                                  String warning,
                                  boolean includeKeys)
Generates a JSON based summary object for the cart.

Parameters:
request - the HTTP servlet request
response - the HTTP servlet response
context - the request context
msgBroker - the message broker
cart - the cart
maxItems - the maximum number of items
warning - optional warning message
includeKeys - optionally include the keys
Returns:
the JSON string

Esri Geoportal Server
1.2.9

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.