Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-30 Thread Josh Spiegel
Simone, thank you for confirming. Josh On Thu, Jan 30, 2020 at 3:13 AM Simone Bordet wrote: > Hi, > > On Mon, Jan 27, 2020 at 10:41 PM Josh Spiegel > wrote: > > > > Simone, > > > > Thanks again. Bug it seems the webapp configuration can't reference ids > set by the server module. > > Right,

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-30 Thread Josh Spiegel
Jan, Thanks! I didn't know you could do from the web configuration but it makes sense. I will give it a try. Thanks, Josh On Thu, Jan 30, 2020 at 4:53 AM Jan Bartel wrote: > Josh, > > In your etc/test.xml file, set the shared resource as an attribute on the > Server: > > >

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-30 Thread Jan Bartel
Josh, In your etc/test.xml file, set the shared resource as an attribute on the Server: myserverfoo HELLO In your webapps/servlet.xml, you can refer to the Server instance and retrieve the attribute, and set it as a context attribute instead: myserverfoo

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-30 Thread Simone Bordet
Hi, On Mon, Jan 27, 2020 at 10:41 PM Josh Spiegel wrote: > > Simone, > > Thanks again. Bug it seems the webapp configuration can't reference ids set > by the server module. Right, my fault. Probably your single file solution is the way to go, then. -- Simone Bordet http://cometd.org

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-27 Thread Josh Spiegel
Simone, Thanks again. Bug it seems the webapp configuration can't reference ids set by the server module. Am I missing something? Here is what I tried: *./webapps/servlet.xml* /ServletExample /Users//ServletExample.war # SERVLET ##

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-27 Thread Simone Bordet
Hi, On Mon, Jan 27, 2020 at 3:58 PM Josh Spiegel wrote: > > 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 >

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-27 Thread Josh Spiegel
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

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-27 Thread Simone Bordet
Hi, On Mon, Jan 27, 2020 at 5:49 AM Josh Spiegel 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

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-26 Thread Josh Spiegel
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

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-20 Thread Josh Spiegel
Thanks, I will try this. On Mon, Jan 20, 2020 at 8:56 AM Simone Bordet wrote: > Hi, > > On Mon, Jan 20, 2020 at 4:53 PM Josh Spiegel wrote: > > > > I have the ConnectionFactory and the Connection implementations. > > I have the Servlet (deployed in a war file) > > > > The

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-20 Thread Josh Spiegel
>From the Connection, I can search Jetty Server for the right servlet context to find state set by the servlet (see code below). But this seems a bit fragile and would appreciate it if anybody knows a cleaner solution. Thanks, Josh Set from servlet: *protected* *void*

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-20 Thread Simone Bordet
Hi, On Mon, Jan 20, 2020 at 4:53 PM Josh Spiegel wrote: > > I have the ConnectionFactory and the Connection implementations. > I have the Servlet (deployed in a war file) > > The ConnectionFactory/Connection are deployed using a Jetty module/xml with > start.jar. > The servlet is deployed by

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-20 Thread Josh Spiegel
I have the ConnectionFactory and the Connection implementations. I have the Servlet (deployed in a war file) The ConnectionFactory/Connection are deployed using a Jetty module/xml with start.jar. The servlet is deployed by dropping the war file in webapps. I have some dynamic state (mainly

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-20 Thread Greg Wilkins
Generally communication between components in the server space and those in the application space is best done by using a context attribute (with a lot of care about classpath visibility). On Mon, 20 Jan 2020 at 00:36, Josh Spiegel wrote: > Hi, > > What is the cleanest way for a servlet (e.g.

Re: [jetty-users] Communication between a Servlet and a custom protocol

2020-01-20 Thread Simone Bordet
Hi, On Mon, Jan 20, 2020 at 12:36 AM Josh Spiegel wrote: > > Hi, > > What is the cleanest way for a servlet (e.g. in a war file under webapps) to > communicate state with a custom ConnectionFactory running in the same server? A custom ConnectionFactory typically creates Connections that parse

[jetty-users] Communication between a Servlet and a custom protocol

2020-01-19 Thread Josh Spiegel
Hi, What is the cleanest way for a servlet (e.g. in a war file under webapps) to communicate state with a custom ConnectionFactory running in the same server?Is there is some way to set Server attributes from the servlet or something like that? A static variable would probably work for me but I