Get request URL in JSP which is forwarded by Servlet

后端 未结 8 1469
忘掉有多难
忘掉有多难 2020-11-29 22:27

How can I get request URL in JSP which is forwarded by Servlet?

If I run following code in JSP,

System.out.println(\"servlet path= \" + request.getSe         


        
8条回答
  •  再見小時候
    2020-11-29 22:46

    To avoid using scriplets in the jsp, follow the advice of "divideByZero", and use ${pageContext.request.requestURI} This is a better way to go.

提交回复
热议问题