我用STRUTS做了个简单的页面转发,
index.jsp如下:
<html:form action="/user">
  username : <html:text property="username"/<br/>
<html:submit/><html:cancel/>
</html:form>Action中不执行任何操作,直接跳转到success.jsp
success.jsp如下:
<html:form action="/user">
  username : <html:text property="username"/<br/>
</html:form>问题:我在index.jsp中输入cc,点击提交,为什么在success.jsp中会显示出cc?
      我没有在action中做任何操作,
     我认为只有在action中setAttribute(...,...),然后再页面上<bean:write name=...>才能显示出cc的。     

解决方案 »

  1.   

    值存在Actionform里 然后Actionform 被setAttribute 在request或者session里面
    就传到success.jsp了
      

  2.   

    from会自动记录页面上的值,不一定非要setAttribute
      

  3.   

    用action跳转页面的时候,会把form传递到目标页面。
      

  4.   

    楼上能推荐本struts的工作原理的书么?或者视频?
      

  5.   

    你在Action中设置下短点,跟踪,看看走没走Action
      

  6.   

    这就是Struts的Form导航功能,如果上下两个页面的form一样,那么form中的值会自动付到下一页面的表单中
      

  7.   

    能推荐本struts的工作原理的书么
    好多书都只是将struts的使用,没有具体深入将它的原理
      

  8.   

    精通Struts:基于MVC的JavaWeb设计与开发(孙卫琴)
      

  9.   

    精通Struts:基于MVC的JavaWeb设计与开发(孙卫琴)