调用struts的action路径问题。
问题描述:我使用的是DispatchBaseAction,这样就可以在一个页面中使用多个提交了。
但是这样就出现了问题。我把所有页面放入到一个叫pages的文件夹中。这样打开初始的url为
http://localhost:8088/KP/pages/workresult_examination.jsp
点击一个提交页面的url变成
http://localhost:8088/KP/chengguo.do?method=find
可以看到页面的路径变化了。
我使用js来实现参数赋值的如下
function goto(a,b){ var frm=document.forms[0]; var ac = "../chengguo.do?method="+a+"&bh="+b; frm.action=ac; frm.submit(); }frm.action = "<html:write href = 'xxx.do'>"frm.action = "<html:write page = 'xxx.do'>"