Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to log application URL on startup?(As a beginner, I'm struggling to access this information before any UI thread is started.)
How to log application URL on startup? [message #1834394] Mon, 09 November 2020 16:15 Go to next message
Daniel F. is currently offline Daniel F.Friend
Messages: 1
Registered: November 2020
Junior Member
Hello everyone,

I've recently joined my company and we have a pretty large codebase in RAP which I've been studying and wrapping my head around.

I know that information like the context path, a fixed port etc. can be set and read in the launch configuration. On the surface the question is not necessarily about the port or hostname, but rather how I can run an initialization code which

  • does not require an active user session (i.e. no UI thread)
  • has access to Servlet information (Equinox Container, Jetty,..)

The conditions above are important, because as soon as there is an active user session, the information is easily accessible via the RWT class and is therefore trivial. Considering the Servlet information, I've tried to retrieve this in our own AbstractUIPlugin subclass' start() method by getting the EnvironmentInfo through BundleContext, however these (host, port) do not reside there.

Furthermore, I tried to solve this in various "filter" classes, but these either don't have access to those information at initialization time or are not even instantiated yet.

From a practical point of view, this is a minor thing. All I want for the sake of understanding and completeness that the console dynamically prints out the application URL after it has been started. Similarly how Spring Boot reports during startup where the application is listening on (without any browser/window open or active user sessions whatsoever).

Can maybe someone point me into the right direction? I suppose I would have to "inject" my code near where the Equinox Container is set up but I haven't been able to find any documentation or clues yet. Any help would be much appreciated.

Re: How to log application URL on startup? [message #1834556 is a reply to message #1834394] Thu, 12 November 2020 11:15 Go to previous message
Jean-Pascal Laux is currently offline Jean-Pascal LauxFriend
Messages: 81
Registered: December 2011
If you use a servlet container like Tomcat, you can create a servlet configured with load on startup equals 0 (Tomcat) and write some code in the init() function.
Previous Topic:Loading PDF with PDFBox
Next Topic:Asimov$JPL1804
Goto Forum:

Current Time: Fri Jun 21 07:55:04 GMT 2024

Powered by FUDForum. Page generated in 0.02845 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top