rs.close();
st.close();
closeConnectionDB();
---------------------------
把这几个去掉试试!

解决方案 »

  1.   

    <action-mappings>
        <action    path      = "/loginAction"
                   type      = "loginstruts.LoginAction"
                   name      = "LoginForm"
                   scope     = "request"
                   input     = "/Login.jsp">
          <forward name="Success" path="/Welcome.jsp" redirect="true" />
          <forward name="Failure" path="/Login.jsp" redirect="true" />
        </action>
      </action-mappings>这段改成:
    <action-mappings>
        <action    path      = "/loginAction"
                   type      = "loginstruts.LoginAction"
                   name      = "LoginForm"
                   scope     = "request"
                   input     = "/Login.jsp">
          <forward name="Success" path="/Welcome.jsp" redirect="false" /><!-如果设为true就不会把参数转发-->
          <forward name="Failure" path="/Login.jsp" redirect="false" />
        </action>
      </action-mappings>
      

  2.   

    <logic:present name="userbean"  scope="request">
          <h2>Hello,
          <bean:write name="userbean" property="name" />!<p>
        </h2>
        </logic:present>你的是个对象,直接这样输出是不行的,需要这样写
        <logic:present name="userbean"  scope="request">
          <h2>Hello,
          <bean:define id="elment" name="userbean"/>
          <bean:write name="elment" property="name" />!<p>
        </h2>
        </logic:present>   当然前提你的User user=new User(userName,password);必须是返回了一个user对象,而且不为空,否则就是显示不出来。
      

  3.   

    重定向改为false,后会出现方法找不到的错误:javax.servlet.ServletException: No getter method for property name of bean userbean
      

  4.   

    不是什么重定向,是你的模型对象里面没有get方法
      

  5.   

    Request 只能保存字符串  保存在 Session 里吧
      

  6.   

    <bean:write name="elment" property="UserName" />!<p>
      

  7.   

    测试了,首先的确必须把struts-config.xml中跳转中的redirect改为"false",才能够在跳转页获取值。我是在Welcome.jsp中用java语句获取得的。所以,我下面这段写法也是写错了(上面的错误就是出现在这里),另外我用tcmis的写法也不行。按尽量在jsp少用java语句的原则,应该如何修改。
        <logic:present name="userbean"  scope="request">
          <h2>Hello,
          <bean:write name="userbean" property="name" />!<p>
        </h2>
        </logic:present>
      

  8.   

    Request 只能保存字符串  保存在 Session 里吧错了,request是可以存对象的。
    你可以去查查:reqwuest.setAttribute(String,Object);
      

  9.   

    我狂晕,原来是自己头晕搞错了,property="name"这里,自己在User中用户名属性是用userName,不是name,怪不得读不出来改为:
        <logic:present name="userbean"  scope="request">
          <h2>Hello,
          <bean:write name="userbean" property="userName" />!<p><!-- property="name"改为User.java中的userName,注:bean:define 不用这样写也是可以的 -->
        </h2>
        </logic:present>谢谢大家!!