Package org.mitre.dsmiley.httpproxy
Class URITemplateProxyServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.mitre.dsmiley.httpproxy.ProxyServlet
-
- org.mitre.dsmiley.httpproxy.URITemplateProxyServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class URITemplateProxyServlet extends ProxyServlet
A proxy servlet in which the target URI is templated from incoming request parameters. The format adheres to the URI Template RFC, "Level 1". Example:targetUri = http://{host}:{port}/{path}--which has the template variables. The incoming request must contain query args of these names. They are removed when the request is sent to the target.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringtargetUriTemplateprotected static PatternTEMPLATE_PATTERN-
Fields inherited from class org.mitre.dsmiley.httpproxy.ProxyServlet
asciiQueryChars, ATTR_TARGET_HOST, ATTR_TARGET_URI, connectionRequestTimeout, connectTimeout, doForwardIP, doHandleCompression, doHandleRedirects, doLog, doPreserveCookies, doPreserveHost, doSendUrlFragment, hopByHopHeaders, maxConnections, P_CONNECTIONREQUESTTIMEOUT, P_CONNECTTIMEOUT, P_FORWARDEDFOR, P_HANDLECOMPRESSION, P_HANDLEREDIRECTS, P_LOG, P_MAXCONNECTIONS, P_PRESERVECOOKIES, P_PRESERVEHOST, P_READTIMEOUT, P_TARGET_URI, P_USESYSTEMPROPERTIES, readTimeout, targetHost, targetUri, targetUriObj, useSystemProperties
-
-
Constructor Summary
Constructors Constructor Description URITemplateProxyServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinitTarget()protected StringrewriteQueryStringFromRequest(javax.servlet.http.HttpServletRequest servletRequest, String queryString)protected voidservice(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)-
Methods inherited from class org.mitre.dsmiley.httpproxy.ProxyServlet
buildHttpClient, buildProxyCookiePath, buildRequestConfig, buildSocketConfig, closeQuietly, copyProxyCookie, copyRequestHeader, copyRequestHeaders, copyResponseEntity, copyResponseHeader, copyResponseHeaders, createHttpClient, createProxyCookie, destroy, doExecute, encodeUriQuery, getConfigParam, getCookieNamePrefix, getHttpClientBuilder, getProxyClient, getProxyCookieName, getRealCookie, getServletInfo, getTargetHost, getTargetUri, getTargetUri, handleRequestException, init, newProxyRequestWithEntity, rewritePathInfoFromRequest, rewriteUrlFromRequest, rewriteUrlFromResponse
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
initTarget
protected void initTarget() throws javax.servlet.ServletException- Overrides:
initTargetin classProxyServlet- Throws:
javax.servlet.ServletException
-
service
protected void service(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse) throws javax.servlet.ServletException, IOException- Overrides:
servicein classProxyServlet- Throws:
javax.servlet.ServletExceptionIOException
-
rewriteQueryStringFromRequest
protected String rewriteQueryStringFromRequest(javax.servlet.http.HttpServletRequest servletRequest, String queryString)
- Overrides:
rewriteQueryStringFromRequestin classProxyServlet
-
-