我正在使用第三方 API,它需要在其中一个 JSP 中发送完整的 URL。我需要将 URL 设置为
http://localhost:8080/MyWebApp/add.action
我可以实现/MyWebApp/add.action
使用<s:action/>
但是如何获取 http://localhost:8080
在Struts2 中?
最佳答案
使用s:url
标签。包含属性 forceAddSchemeHostAndPort="true"
。
关于java - Struts 2 - 获取应用程序的完整 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19137588/