Struts2 URL label contextpath problem

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
Web application deployment, is likely to have different context path. in order to solve this problem,
You can use<%String contextPath = request.getContextPath();%>
But JSP write java code is not always beautiful
In Struts2 you can use El expressions${pageContext.request.contextPath}

Struts2 can also use the URL tag, it will automatically add the context path
<s:url action="Wqpcp" namespace="/water"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Wordsworth at June 17, 2014 - 11:31 AM