Class APIFilter

java.lang.Object
com.softslate.commerce.customer.core.BaseFilter
com.softslate.commerce.customer.core.APIFilter
All Implemented Interfaces:
javax.servlet.Filter

public final class APIFilter extends BaseFilter implements javax.servlet.Filter
Maps /api requests to the appropriate .do URI. This can be thought of as the first half of a wrapper surrounding Struts for API calls. This part of the wrapper maps request under /api to the .do URLs that Struts needs. The second half of the wrapper is the JSON output that is generated from /WEB-INF/templates/administrator/default/json/apiResponse.jsp and the other files it calls.
Author:
David Tobey
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javax.servlet.FilterConfig
     
    (package private) static org.apache.commons.logging.Log
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
     
    void
    init(javax.servlet.FilterConfig filterConfig)
     
    private String
    translateAPIURL(javax.servlet.http.HttpServletRequest req)
     

    Methods inherited from class com.softslate.commerce.customer.core.BaseFilter

    isStaticRequest

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      static org.apache.commons.logging.Log log
    • filterConfig

      private javax.servlet.FilterConfig filterConfig
  • Constructor Details

    • APIFilter

      public APIFilter()
  • Method Details

    • init

      public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
      Specified by:
      init in interface javax.servlet.Filter
      Throws:
      javax.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface javax.servlet.Filter
    • doFilter

      public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
      Specified by:
      doFilter in interface javax.servlet.Filter
      Throws:
      IOException
      javax.servlet.ServletException
    • translateAPIURL

      private String translateAPIURL(javax.servlet.http.HttpServletRequest req)