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

Thanks.  I can definitely break things up and use a module.  However, using webapps and configuring WebAppContext via mywar.xml doesn't seem to work since the call to webAppContext.getServer() returns null at the time the WebAppContext is configured.  

I'm mainly interested in knowing if the call to server.setHandler(webAppContext) is just as good as using ./webapps and configuring WebAppContext?

Thanks,
Josh


On Mon, Jan 27, 2020 at 1:48 AM Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
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.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top