在我的應用程序中,當用戶註冊時,會向用戶的電子郵件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>";
在此先感謝。