struts框架下如果不用session怎样把后台数据传到前台(请给出发送和接受代码)
解决方案 »
- jquery easyui 怎么设置标题列居左,里面的数据列居右?
- 求个struts2 spring hibernate项目
- 关于dao和javabean
- 再次请求大虾检查<jsp:getProperty>出错,请大虾帮忙~在线等啊~
- 如何更换服务器的bean
- 用TransactionTemplate,但事务还是不能回滚
- 哪位牛人解释一下这12行代码,Google上搜不到
- 怎么把一个结果集写入到一个excel文件下载到客户端??急!!!谢谢!
- 紧急:我在配置tomcat时,不能进入管理界面!?
- 那位有springmvc3 + easyui+oracle的分页程序,能否提供学习下
- jsp编译出错,请高手帮帮忙
- 高手帮忙!为什么我的word文件不能在右边小窗口mainFrame中打开?
response.getAttribute("");
so you can get the data from the Form
like:
<html:form>
<td><html:password property="password" size="15" />
</html:form>
you can define the proerty in the form
你用了struts的html标签<html:form action="/TestAction">的话 ,在action中reqeust.setAttribute("testForm",obj),session.setAttribute("testForm",obj)在jsp自动会填写的或者jsp中 requst.getAttribute("XXX"),session.getAttrubute("XXX")自己取出来,爱怎么用就怎么用(没有<html:form>的时候只好这样了)
ex:
..........
request.setAttribute("object",MyObject);.......
在页面可以通过标签或者scriplet来获取
MyObject o = (MyObject)request.getAttribut("object");
o.method();...