Mr. xiaodongx 问了我这个问题,没做实验不敢妄下结论,现写如下代码test一下
code block 1
public class TestAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
TestForm actionform = (TestForm) form;
actionform.setP("p1");
TestForm actionform2=new TestForm();
actionform2.setP("p2");
request.getSession().setAttribute("vo",actionform2);
request.setAttribute("vo",actionform);
return mapping.findForward("input");
}
code blcok2
<bean:write name="vo" property="p"/>
此时页面显示p1
如果屏蔽掉绿色代码,页面显示p2
于是得出结论
<bean:write >标签先从request中读取数据,没有就从session中读,再没有就报错
分享到:
相关推荐
NULL 博文链接:https://lygle.iteye.com/blog/857025
bean:write 9 html:base 10 html:cancel 11 html:select 12 html:checkbox 14 html:radio 15 html:multibox 15 html:link 16 html:errors 18 html:javascript 20 html:xhtml 21 logic:iterate 21 logic:present 23 ...
struts-bean标签 自已讲课用的,初稿 PPT
struts-bean.tld struts开发插件
struts-bean
struts2 <s:if>标签使用struts2 <s:if>标签使用struts2 <s:if>标签使用struts2 <s:if>标签使用struts2 <s:if>标签使用struts2 <s:if>标签使用
NULL 博文链接:https://shupili141005.iteye.com/blog/667446
2009 MLDN魔乐科技 Struts课堂实战视频教程 全6讲 01-Struts_简介与登陆...02-Struts_工作原理与核心配置 03-Struts_对于输入参数的处理 04-Struts_Bean标签功能 05-Struts_Struts国际化处理 非常经典,适合初学者!
免费资源struts-bean.tld,可以直接添加进项目,然后修改web.xml即可
我就是靠这个文档实现logic:iterate的循环的 struts 标签 logic:iterate使用 logic:iterate <br>第一页 是struts官方的说明, 第二页 是个例子 第三页 是我实现的arrayList放入标签的方法。 这是页面...
<tagclass>org.apache.struts.taglib.bean.WriteTag</tagclass> //这个Tag是由那个类实现的(这个class可以在struts.jar包中找到) <bodycontent>empty //这个Tag可以直接结尾,不需要填写内容 //这里bodycontent有...