Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] From ServletConfig to Server

Hi All:

I embed Jetty 8.1.3 in our server. In jetty.xml file, I have custom servlets with a bunch of init parameters. Some of these are relative file paths which servlets need to resolve based on a directory that is know to our server. This directory is the directory that contains jetty.xml. The files will be resolved based on the directory jetty.xml lives in.

When I embed Jetty, I add a custom attribute to the Jetty Server instance with the directory to be used by the (WebSocket) servlets to resolve their init params.

When a serlvet starts it is given a ServletConfig object. How do I get from there to the Server it lives in so I can read the custom attribute?

I can see in the debugger that I can navigate to a server field but I do not see how to do this with the Jetty API.

Any clues please?

Thank you!
Gary

--
E-Mail: garydgregory@xxxxxxxxx | ggregory@xxxxxxxxxx
JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
Spring Batch in Action: http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Back to the top