Class ProxyServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, org.pentaho.platform.api.engine.ILogger

    public class ProxyServlet
    extends ServletBase
    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 actiually 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>com.pentaho.ui.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 atmy.remoteserver.com:8080

    NOTES:

    For this to be useful, both Pentaho servers should be using the same database repository.

    The recieving server should have the ProxyTrustingFilter enabled to handle authicentation.

    This Servlet only works with GET requests. All requests in the Pentaho BI Platform are currently gets.

    Author:
    Doug Moran
    See Also:
    ProxyTrustingFilter, Serialized Form
    • Constructor Detail

      • ProxyServlet

        public ProxyServlet()
        Base Constructor
    • Method Detail

      • getLogger

        public org.apache.commons.logging.Log getLogger()
        Specified by:
        getLogger in class ServletBase
      • init

        public void init​(javax.servlet.ServletConfig servletConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • getProxyURL

        public String getProxyURL()
      • getErrorURL

        public String getErrorURL()
      • isLocaleOverrideEnabled

        public boolean isLocaleOverrideEnabled()
      • doProxy

        protected void doProxy​(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
                        throws IOException
        Throws:
        IOException
      • doProxyCore

        protected void doProxyCore​(URI requestUri,
                                   javax.servlet.http.HttpServletResponse response)
      • service

        protected void service​(javax.servlet.http.HttpServletRequest arg0,
                               javax.servlet.http.HttpServletResponse arg1)
                        throws javax.servlet.ServletException,
                               IOException
        Overrides:
        service in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              IOException
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException