On Apr 8, 2010, at 12:43 PM, Daniel Mischler wrote:
>
> I'm developing an application that needs to configure some lengthy things at startup time. In order to do that it would be helpful to get the base uri.
>
> What is the (best) way to get that accomplished? I figure that working with UriInfo does not work since I don't have a request coming in, correct?
>
> BTW im working with Jersey and EJB 3 on Glassfish.
>
Would it be possible for you to defer your lengthy initialization until the first request. Kind of a pain I know but the underlying servlet container doesn't provide enough information to determine the base URI until it dispatches the first request to the Jersey servlet so I can't think of any other way round the issue unless you put the base URI into an init-param in the web.xml (which creates its own set of issues).
Marc.