在我的应用程序中,当用户注册时,会向用户的电子邮件ID发送链接。我想给该应用程序的动态URL即获取动态应用程序URL
生产服务器:https://example.com/APP/
测试服务器:https://test.example.com/APP/ 地方:http://LOCAL_IP:LOCAL_PORT/APP/
生产和测试服务器背后的代理服务器。
我正在使用以下来生成网址。这对本地工作很好,但对于测试和生产而言,它正在生成具有实际IP和端口的URL。我想生成像https://test.example.com/APP/,https://example.com/APP/分别/
final String PROTOCOL = httpRequest.getScheme()+"://";
final String REMOTE_HOST = httpRequest.getLocalAddr();
final String PORT = ":"+httpRequest.getServerPort();
final String CONTEXT = httpRequest.getContextPath();
String url = "<a href='"+ PROTOCOL + REMOTE_HOST + PORT + CONTEXT + "' >" +
"Click Here to Proceed</a>";
在此先感谢。