|
Re: Get IP Address from Client Session [message #1831672 is a reply to message #1831659] |
Wed, 26 August 2020 10:39 |
|
Not by default. But you could provide your own Java implementation of a "org.eclipse.scout.rt.ui.html.UiSession" by using Scout's BEANS / @Replace mechanism. Override #getOrCreateClientSession and add the IP information from the HttpServletRequest to the jsonStartupReq.getSessionStartupParams() Map. Later you can access the startup params via AbstractDesktop#getStartupRequestParam(String).
Cheers
André
Eclipse Scout Homepage | Documentation | GitHub
|
|
|
|
Re: Get IP Address from Client Session [message #1832036 is a reply to message #1832013] |
Mon, 07 September 2020 07:21 |
|
Just create a new map instance then. You could override UiSession#createAndStartClientSession to do that (untested):
protected IClientSession createAndStartClientSession(Locale locale, UserAgent userAgent, Map<String, String> sessionStartupParams) {
Map<String, String> modfiableMap = new HashMap<>(sessionStartupParams);
modifiableMap.put("ipAddress", "[value]");
return BEANS.get(ClientSessionProvider.class).provide(ClientRunContexts.copyCurrent()
.withLocale(locale)
.withUserAgent(userAgent)
.withProperties(modifiableMap)); // Make startup parameters available at {@link PropertyMap#CURRENT} during client session is starting.
}
Cheers
André
Eclipse Scout Homepage | Documentation | GitHub
[Updated on: Mon, 07 September 2020 11:26] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03887 seconds