In the Client Project create an externalType file in the EGLSource folder named CustomFunctions.egl with this source code:
package externalTypes;
externalType CustomFunctions type JavaScriptObject{relativePath = "customJavaScript/functions", javaScriptName = "customFunctions"}
function getIP() returns(string);
end
In the Client Project create a JavaScript file file named customFunctions.js in /WebContent/customJavaScript/functions/ (you have to create those folders under WebContent) with this source code:
egl
.defineClass(
'customJavaScript.functions',
'customFunctions',
{
"constructor" : function() {
},
"getIP" : function(URL) {
xhttp = new XMLHttpRequest();
xhttp.open("GET", "http://yourServerIP:yourServerPort/yourServerPackageName/getIP.jsp", false);
try {
xhttp.send("");
} catch (e) {
// Do something
}
x = xhttp.responseText;
return x;
}
);
In the Client Project create a jsp file file named getIP.jsp directly in the WebContent folder with this source code:
<%= request.getRemoteAddr() %>
To get the IP of the client use this function in a rui program
customFunctions CustomFunctions{};
ip string = customFunctions.getIP();
Hope it's clear now.
Kind regards!
------------------------------
Marcel Dreyer
------------------------------
Original Message:
Sent: Wed September 08, 2021 08:32 AM
From: Osvaldo Jose de Oliveira Menezes
Subject: IP or File into station front-end windows
ops. Tks @Marcel Dreyer
------------------------------
Osvaldo Jose de Oliveira Menezes
Analista
RellegusTI
Orlândia
+55 16 3818-0203
Original Message:
Sent: Wed September 08, 2021 08:23 AM
From: Marcel Dreyer
Subject: IP or File into station front-end windows
The solution I've provided is working with websphere, we are using this solutions since years.
Kind regards!
------------------------------
Marcel Dreyer
Original Message:
Sent: Wed September 08, 2021 08:16 AM
From: Osvaldo Jose de Oliveira Menezes
Subject: IP or File into station front-end windows
Masters,
I analyzed the link provided, and as we work with websphere, I've been researching other sources and the link below would be a solution for us to work with websphere? How to implement? Has anyone used it?
Wait
https://mkyong.com/java/how-to-get-client-ip-address-in-java/
------------------------------
Osvaldo Jose de Oliveira Menezes
Analista
RellegusTI
Orlândia
+55 16 3818-0203
Original Message:
Sent: Mon September 06, 2021 02:10 AM
From: Marcel Dreyer
Subject: IP or File into station front-end windows
Hi,
please take a look at answer 5 in this thread: get ip address from client
Kind Regards!
------------------------------
Marcel Dreyer
Original Message:
Sent: Fri September 03, 2021 07:34 AM
From: Osvaldo Jose de Oliveira Menezes
Subject: IP or File into station front-end windows
Hello masters.
See if they've already done that.
I need to get the IP of a windows station (front-end)..
The RUI (front-end) running wbsphere, when I look for the ip I bring the server IP. I need to get the frontend IP.
Any suggestion?
Well, one of the alternatives I thought was to put a file containing this IP, but how to load it?
Is there any library with ready-made commands for this (example: syslib)?
Can anyone bring ideas? solutions?
Appreciate
------------------------------
Osvaldo Jose de Oliveira Menezes
Analista
RellegusTI
Orlândia
+55 16 3818-0203
------------------------------