今天弄项目的时候遇到了这么个问题:先来贴一下html的代码吧……<form name="getpages">
<select id="pagemanager" onchange="turnPage(this)">
<s:iterator value="pagelist">
<option value="<s:property/>">
<s:property/>
</option>
</s:iterator>
</select>
</form>这是JS代码:function turnPage()
{
var url = "UserManage?dis=view&page=" + obj(obj.selectedIndex).value;
[UserManage 这里加上action也无效]
document.getpages.action = url;
document.getpages.submit(); //这里要是用 window.location.href = url 就好使了
}上面的这个代码 在JS里面测试的时候 url变量经验证都是正确的 参数什么的都有,但是传到后台使用request获取的时候就是null了同样的代码,使用 window.location.href 就没有任何问题,
所以我能想到的也就是只能是struts2的拦截器在传递时将参数给清空了,
但是如果是这样的话该如何配置struts2呢? 求教!另外,如果使用 window那个方法的话 我还要在后面加上N多的变量,所以不想用那个……
<select id="pagemanager" onchange="turnPage(this)">
<s:iterator value="pagelist">
<option value="<s:property/>">
<s:property/>
</option>
</s:iterator>
</select>
</form>这是JS代码:function turnPage()
{
var url = "UserManage?dis=view&page=" + obj(obj.selectedIndex).value;
[UserManage 这里加上action也无效]
document.getpages.action = url;
document.getpages.submit(); //这里要是用 window.location.href = url 就好使了
}上面的这个代码 在JS里面测试的时候 url变量经验证都是正确的 参数什么的都有,但是传到后台使用request获取的时候就是null了同样的代码,使用 window.location.href 就没有任何问题,
所以我能想到的也就是只能是struts2的拦截器在传递时将参数给清空了,
但是如果是这样的话该如何配置struts2呢? 求教!另外,如果使用 window那个方法的话 我还要在后面加上N多的变量,所以不想用那个……
这里也算是给其他人提个醒吧,本来以为不一定都要用struts2 标签的 哈……