struts中怎么提交带参数的URL?急,在线等

sghys 2006-07-09 04:57:29
struts中,页面地址是:http://xxxx/test.do?id=10 当我提交页面后,在action类的execute方法中如何再返回去提交前的页面也就是http://xxxx/test.do?id=10这个页面,用return actionMapping.getInputForward();和return new ActionForward(actionMapping.getInput());都是返回到http://xxxx/test.do 后面的参数没了,怎么样才样返回提交前的URL:http://xxxx/test.do?id=10
...全文
291 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhuhua 2006-07-11
  • 打赏
  • 举报
回复
恩,用session
sugar900 2006-07-11
  • 打赏
  • 举报
回复
同意楼上的,也可以放到session中
session.setAttribute()
session.getAttribute()
kevinliuu 2006-07-11
  • 打赏
  • 举报
回复
尽量使用request

session中的变量不会清除,除非session失效。 比较占用资源
xiaoxiaoyuying 2006-07-11
  • 打赏
  • 举报
回复
在struts的配置文件中配置参数
chenmingjsw 2006-07-11
  • 打赏
  • 举报
回复
可以先在action中req.setAttribute,然后再在页面request.getAttribute
crazyguo007 2006-07-11
  • 打赏
  • 举报
回复
response.sendRedirect("http://xxxx/test.do?id=10 ");试试
rickhunterchen 2006-07-10
  • 打赏
  • 举报
回复
不能带参数,你可以先在action中req.setAttribute,然后再在页面request.getAttribute。
sime59 2006-07-09
  • 打赏
  • 举报
回复
你可以尝试用HTML本来的不就好了?
southgate 2006-07-09
  • 打赏
  • 举报
回复
写一个
<forward name="success2" path="/jsp/xxxx/test.do?id=10"/>
不就好了?
ttaallkk1 2006-07-09
  • 打赏
  • 举报
回复
有个返回历史页面
可以试下

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧