action中写
String form="123";
request.setAttribute("form",form);jsp中写
String form=(String)request.getAttribute(form);
out.println(form);

解决方案 »

  1.   

    String val = "给我分";
    String username = request.getSession.SetAttribute("username",val);得:
    String nameto= request.getSession().GetAttribute("username");
      

  2.   

    jsp:
    <bean:write name="form"/>
      

  3.   

    在传统的应用程序对ActionForm Bean的访问中,我们通常都写成如下的形式: Connection conn=DriverManager.getConnection("JDBC URL ");
          sql=" select *  from some tables ";
    PreparedStatement stmt = conn.prepareStatement(sql);
          ResultSet rs = stmt.executeQuery();
    ArrayList array=new ArrayList();
    while (rs.next()) {
       AActionForm actionForm =new AActionForm ();
       actionForm.setId(rs.getString("Id"));
       actionForm.setName(rs.getString("Name"));           
       array.add(actionForm);
    }
    request.setAttribute("array", array);   
     
    在Action 的Execute方法中,我们 把这个集合用request.setAttribute("array", array)存储起来,然后在JSP页面中,我们用iterate Tag把数据循环现实出来。代码通常都是这个样子: 
    <logic:present name=" array " scope="request">
    <logic:iterate name=" array " id=" array " 
    type="com.bhsky.webis.Goods">
     <tr align="center"> 
        <td class="table2">
    <bean:write name=" array " property="goodsid"/>
    </td>
    <td class="table2">
    <bean:write name=" array " property="goodsname"/>
    </td>
      </tr>
      </logic:iterate> 
    </logic:present>
      

  4.   

    http://dev.csdn.net/user/kui
    《如何在Struts 数据库应用程序中实现分页显示(1) 》