The ServletConverter example has the following code:

    public void init() throws ServletException {
        super.init();
        this.converter = new ServletConverter(getServletContext());


This will actually cause serious breakage in a production system.

To reproduce, try hitting your thus-exposed Restlet from http://localhost...
and then try hitting it from your IP address.  In the latter case you will
get a blank page.  Restart your webapp and switch it around and you will see
it's a "first come first serve" thing.

The reason is that the converter binds to the servlet context of created
when the "init" method is first called (lazily), and will not listen to
requests coming from any other base URL.

I got around this by creating a new servlet converter instance for each
service request.  I'm not sure if this is the "right" way, however -- will
this lead to efficiency problems?

--
Ryan Daum
[EMAIL PROTECTED]
Senior Developer, Toronto
647.724.5232 x 2073

Reply via email to