先用request.getAttribute()取得,再用<bean:write>显示出来

解决方案 »

  1.   

    对于直接显示的内容,用楼上说的<bean:write>,
    例如:<bean:write name='lyk' property="mybeanvariable1" />
    对于与struts taglib 相关联的,通过设置标签的name和property属性来实现,
    例如:<html:text  name='lyk'  property="mybeanvariable1" />
      

  2.   

    对于<Form>内与<Form>相同的bean,如果不写明name属性,会自动采用<Form>对应的bean.
      

  3.   

    还是不行呀!
    我是想在Action类中(而不是Form Bean类)用request.setAttribute()发送数据。
    在jsp页面不需要编写java代码(即使是request.getAttribute()也不行);
    而是通过使用常见的struts taglib 将数据显示出来!!
    <bean:write〉标签库是和Form Bean绑定,和Action类没有什么关系呀!
      

  4.   

    如果用了request.setAttribute()set的是一个数字,那么直接用request.getAttribute()就好了;如果是一个FormBean或者其他对象,那么就强制转换一下而已