问题描述:例如:当前路径:127.0.0.1:8080/test/content/content.action 返回到content页面
问题:如何在content.jsp页面如何获取:127.0.0.1:8080/test/content/content.action ?
注:String url=request.getScheme()+"://" + request.getHeader("host") + request.getRequestURI()+request.getQueryString();
这个获取的是:127.0.0.1:8080/test/web-inf/view/content.jsp?
如何获取:127.0.0.1:8080/test/content/content.action 路径?
js ------> thisURL=document.URL
String realPath = "http://" +
request.getServerName() +
":" +
request.getServerPort() +
request.getConte......
答案就在这里:Jsp 获取当前访问url
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。
当你进入控制层的时候先获取到uri然后等所有操作都完成以后,request.setatrribute到页面,就跟传普通变量一样就行呗
在控制层获取,然后传到页面