Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Tracking Ajax requests/responses with Jetty ProxyServlet

I did that to start the server (see code below).
Do I have to setup the uri somewhere? I thought the addServlet method would do the job.

public static void main(String[] args) throws Exception {

        

Server server = new Server();

        ServerConnector connector = new ServerConnector(server);

        connector.setPort(8888);

        server.addConnector(connector);

        // Setup proxy handler to handle CONNECT methods

        ConnectHandler proxy = new ConnectHandler();

        server.setHandler(proxy);

        // Setup proxy servlet

        ServletContextHandler context = new ServletContextHandler(proxy, "/", ServletContextHandler.SESSIONS);

        ServletHolder proxyServlet = new ServletHolder(MyProxy.class);


        context.addServlet(proxyServlet, "/*");

        System.out.println("Starting the proxy server");

        server.start();

        

}


Regards


Gilles



2014-08-21 14:08 GMT+02:00 Simone Bordet <sbordet@xxxxxxxxxxx>:
Hi,

On Wed, Aug 20, 2014 at 10:07 PM, Gilles Ducret <gilles.ducret@xxxxxxxxx> wrote:
> Hi,
>
> I have created a ProxyServlet to intercept the Ajax JSON request of a third
> party tool we have acquired in the company.
> My objective is to modify some of the response on the fly.
>
> I hav a first issue, that is I can't intercept the json calls, can't track
> them. They go through the proxy (when the proxy is done the browser displays
> an error message), but I see no traces of them (neither in service, nor in
> onresponsecontent, nor in onresponsesuccess).

Then you servlet mapping does not match the URI of the ajax call ?

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top