Package org.pentaho.platform.web.servlet
Class ProxyServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.pentaho.platform.web.servlet.ServletBase
org.pentaho.platform.web.servlet.ProxyServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig,org.pentaho.platform.api.engine.ILogger
This servlet is used to Proxy a Servlet request to another server for processing and returns that result to the
caller as if this Servlet actually serviced it. Setup the proxy by editing the web.xml to map the servlet
name you want to proxy to the Proxy Servlet class.
<servlet>
<servlet-name>ViewAction</servlet-name>
<servlet-class>org.pentaho.platform.web.servlet.ProxyServlet</servlet-class>
<init-param>
<param-name>ProxyURL</param-name>
<param-value>http://my.remoteserver.com:8080/pentaho</param-value>
</init-param>
</servlet>
In the above example, all requests to /ViewAction will be forwarded to the ViewAction Servlet running on the Hitachi Vantara server at my.remoteserver.com:8080
NOTES:
For this to be useful, both Pentaho servers should be using the same database repository.
The receiving server should have the ProxyTrustingFilter enabled to handle authentication.
This Servlet works with GET and POST requests. All requests in the Pentaho BI Platform are currently GET requests.
- Author:
- Doug Moran
- See Also:
-
Field Summary
Fields inherited from class org.pentaho.platform.web.servlet.ServletBase
debugFields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected URIbuildProxiedUri(javax.servlet.http.HttpServletRequest request, String userName) protected voidcopyContent(InputStream in, OutputStream out) protected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected voiddoProxy(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected voiddoProxyCore(URI requestUri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) org.apache.commons.logging.Logvoidinit(javax.servlet.ServletConfig servletConfig) booleanprotected voidservice(javax.servlet.http.HttpServletRequest arg0, javax.servlet.http.HttpServletResponse arg1) Methods inherited from class org.pentaho.platform.web.servlet.ServletBase
debug, debug, error, error, fatal, fatal, getLoggingLevel, getObjectName, getPentahoSession, info, info, setCorsHeaders, setLoggingLevel, trace, trace, warn, warnMethods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
ProxyServlet
public ProxyServlet()Base Constructor
-
-
Method Details
-
getLogger
public org.apache.commons.logging.Log getLogger()- Specified by:
getLoggerin classServletBase
-
init
public void init(javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException - Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
getProxyURL
-
getErrorURL
-
isLocaleOverrideEnabled
public boolean isLocaleOverrideEnabled() -
doProxy
protected void doProxy(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
buildProxiedUri
protected URI buildProxiedUri(javax.servlet.http.HttpServletRequest request, String userName) throws URISyntaxException, MalformedURLException -
doProxyCore
protected void doProxyCore(URI requestUri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
copyContent
- Throws:
IOException
-
service
protected void service(javax.servlet.http.HttpServletRequest arg0, javax.servlet.http.HttpServletResponse arg1) throws javax.servlet.ServletException, IOException - Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException - Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException - Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-