Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] HTTP requests not handled independently


I have a simple problem with which I require help.

I've embedded Jetty in my project and created a simple Handler to provide web access to my program.

When it serves multiple requests at the exact same moment, the request are being mutated and not served independently. If client 1 makes a request with parameter1=a and client 2 makes a request with parameter1=b at the same time, *both* clients are served with either a OR b.

I followed the Handler tutorial and my code is as follows:

(in Main)

        Server server = new Server();

        SelectChannelConnector httpConnector = new SelectChannelConnector();
        QueuedThreadPool pool = new QueuedThreadPool(50);

        server.setConnectors(new Connector[]{httpConnector});
        server.setHandler(new SelectHandler());


My handler:

public class SelectHandler extends AbstractHandler {

    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        String param = baseRequest.getParameter("parameter1");

What am I missing? Any help will be greatly appreciated..

Back to the top