Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Communication between a Servlet and a custom protocol

Hi,

On Mon, Jan 27, 2020 at 5:49 AM Josh Spiegel <joshlakewg@xxxxxxxxx> wrote:
>
> Hi Simone,
>
> Thank you for the suggestion.  I tried it but it didn't work because getServer() returns null at the time the WebAppContext instance is configured.
>
> Instead, I tried a slight variation on your idea.  I added the connector and the WebAppContext handler explicitly to the server calling setHandler (see below).  Do you think this is a reasonable way to do it?

It is a reasonable way, although it kind of hardcodes a number of
things into the same XML.
You typically want to configure server-related things into XML that
are enabled by modules, and context-related things into context XMLs.

Perhaps a better way to do this would be to put "myContext" and the
connector configuration into one XML enabled by a module,
and have a $JETTY_BASE/webapps/mywar.xml context XML that configures
the WebAppContext.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top