EGL Development User Group

  • 1.  IP or File into station front-end windows

    Posted Fri September 03, 2021 07:34 AM
    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
    ------------------------------


  • 2.  RE: IP or File into station front-end windows

    Posted Mon September 06, 2021 02:11 AM
    Hi,
    please take a look at answer 5 in this thread: get ip address from client

    Kind Regards!

    ------------------------------
    Marcel Dreyer
    ------------------------------



  • 3.  RE: IP or File into station front-end windows

    Posted Wed September 08, 2021 08:17 AM
    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
    ------------------------------



  • 4.  RE: IP or File into station front-end windows

    Posted Wed September 08, 2021 08:24 AM
    The solution I've provided is working with websphere, we are using this solutions since years.
    Kind regards!

    ------------------------------
    Marcel Dreyer
    ------------------------------



  • 5.  RE: IP or File into station front-end windows

    Posted Wed September 08, 2021 08:32 AM
    ops. Tks @Marcel Dreyer


    ------------------------------
    Osvaldo Jose de Oliveira Menezes
    Analista
    RellegusTI
    Orlândia
    +55 16 3818-0203
    ------------------------------



  • 6.  RE: IP or File into station front-end windows

    Posted Thu September 09, 2021 02:15 AM
    Edited by Marcel Dreyer Thu September 09, 2021 02:15 AM


    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
    ------------------------------



  • 7.  RE: IP or File into station front-end windows

    Posted Thu September 09, 2021 10:39 AM
    Excelente @Marcel Dreyer.
    Tks


    ------------------------------
    Osvaldo Jose de Oliveira Menezes
    Analista
    RellegusTI
    Orlândia
    +55 16 3818-0203
    ------------------------------