HI All, I have an app created that relies on pulling the local hostname this then tells the app what functions the workstation is allowed to perform. The Mendix app is currently hosted using Mendix Service Console but when running the app on a client it currently returns the server name the app is running on, below is a copy of the Java action I'm running what am I missing or have done incorrectly. package masterdata.actions; import com.mendix.systemwideinterfaces.core.IContext; import com.mendix.webui.CustomJavaAction; import java.net.InetAddress; import java.net.UnknownHostException; public class GetHostName extends CustomJavaAction<java.lang.String> { public GetHostName(IContext context) { super(context); } @java.lang.Override public java.lang.String executeAction() throws Exception { // BEGIN USER CODE try { InetAddress localMachine = InetAddress.getLocalHost(); return localMachine.getHostName(); } catch (UnknownHostException e) { // Handle the exception if the hostname cannot be determined e.printStackTrace(); return "Unknown"; } // END USER CODE } /** * Returns a string representation of this action * @return a string representation of this action */ @java.lang.Override public java.lang.String toString() { return "GetHostName"; } // BEGIN EXTRA CODE
asked
Stephen Meadows
4 answers
0
No errors all clients show the server hostname not the client which is what i need.
answered
Stephen Meadows
0
Still no joy I'm afraid,
The app we created still returns the hostname of the server running the app not the remote client accessing it.
I have read a few articles that imply its not possible which would have a major impact on moving forward with Mendix.
answered
Stephen Meadows
0
Hi Stephen,
Were you ever able to figure this out? I've been trying to solve the same issue.
Thanks
Matt
answered
Matt Montano
0
Hi Matt,
Yes I did eventually get it working had to create a Microflow to call a Javascript action to get it to work, took some time though as im not a Java person.