Class APIFilter
java.lang.Object
com.softslate.commerce.customer.core.BaseFilter
com.softslate.commerce.customer.core.APIFilter
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionprivate javax.servlet.FilterConfig
(package private) static org.apache.commons.logging.Log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
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
-
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 interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroy
in interfacejavax.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 interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
translateAPIURL
-