I have the below code :
<c:redirect url= "someFile.jsp">
But I need to use the host name when I do the redirect. Somewhat like below :
String servername = request.getServerName();
String myAppUrl = "https://" + servername + "/myApp/";
<c:redirect url= myAppUrl + "someFile.jsp">
But I am getting error with the above code. Tried the below methods as well but none are working :
<c:redirect url= ${myAppUrl} + "someFile.jsp">
<c:redirect url= "${myAppUrl}" + "someFile.jsp">
See my problem is not about fetching the request object.. I can do that and able to access the hostname, context path etc.. But I need to pass them to the url value which i am not sure how to do. Can someone tell me how can use the dynamic url in the above redirection.
question from:
https://stackoverflow.com/questions/65937311/jspredirect-url-with-dynamic-value 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…