我的代码是:
<s:url action="work-items_input" includeParams="get" var="wiLink" namespace="">
<s:param name="workItemVO.workItemId" value="'5'"></s:param>
</s:url>
<s:a action="%{wiLink}" namespace="/myaccount"><s:property value="subject"/></s:a>在我的应用程序的ContextRoot中是"pmp“。在这里,上面是生成链接作为
/pmp//pmp/myaccount/work-items_input.action?ajaxRequest=true&workItemVO.workItemId=5
上面我们可以看到上下文路径将出现两次。/pmp//pmp.这是错误的。如何删除一个额外的上下文路径?
发布于 2015-08-31 12:51:45
以上公认的答案无疑是绝对正确的。但是,我们也可以在"includeContext="false"中使用<s:url>作为动作属性的替代,而不是href。
<s:url action="work-items_input" includeParams="get" var="wiLink" namespace="/myaccount" includeContext="false">
<s:param name="workItemVO.workItemId" value="'5'"></s:param>
</s:url>
<s:a action="%{wiLink}" namespace=""><s:property value="subject"/></s:a>发布于 2017-09-15 16:09:28
它不能工作,因为&所以您必须将所有事件替换为&。
<td align="right">
<s:url action="collectionSummary" var="csUrl">
<s:param name="collectionSummary.name">
<s:property value="debtCase.origNameTxt"/></s:param>
<s:param name="socSecNum">
<s:property value="debtCase.socSecNum"/></s:param>
<s:param name="debtCaseId"><s:property value="debtCase.ID"/></s:param>
<s:param name="nomenu">Y</s:param>
</s:url>
<s:a href="#"
onclick="window.open(clearURL('%{csUrl}'));" <-------
title="View Collection Summary"
class="screen_link">
<s:text name="link.CollSumm"/></s:a>
</td>
function clearURL(element){
return element.replace(new RegExp('&', 'g'),"&");
}https://stackoverflow.com/questions/32311208
复制相似问题