日期:2014-05-18  浏览次数:20752 次

在精通struts的例子里加了个文本框password,但显示的还是username内容,而不是password提交的内容,怎么回师?????
hello.jsp

<%@   page   contentType= "text/html;charset=gb2312 "   language= "java "   %>
<%@   taglib   uri= "/WEB-INF/struts-bean.tld "   prefix= "bean "   %>
<%@   taglib   uri= "/WEB-INF/struts-html.tld "   prefix= "html "   %>
<%@   taglib   uri= "/WEB-INF/struts-logic.tld "   prefix= "logic "   %>
<!--   UTF-8-->
<html:html   locale= "true ">
    <head>
        <title> <bean:message   key= "hello.jsp.title "/> </title>
        <html:base/>
    </head>
    <body   bgcolor= "white "> <p>

        <h2> <bean:message   key= "hello.jsp.page.heading "/> </h2> <p>

      <html:errors/> <p>  

        <logic:present   name= "personbean "   scope= "request ">
              <h2>
                  <bean:message   key= "hello.jsp.page.name "/>
                  <bean:write   name= "personbean "   property= "userName "   /> ! <br> <!--personbean.java的getUserName()=hello   weiqin   -->
                  <bean:message   key= "hello.jsp.page.ps "/>
                  <bean:write   name= "personbean "   property= "passWord "   />  
              </h2>
        </logic:present>

        <html:form   action= "/HelloWorld.do "     > <!--focus= "userName "   -->

            <bean:message   key= "hello.jsp.prompt.person "/>
            <html:text   property= "userName "   size= "16 "   maxlength= "16 "/> <!--   --> <br>
            <bean:message   key= "hello.jsp.prompt.ps "/>
            <html:text   property= "passWord "   size= "16 "   maxlength= "16 "/> <br>
            <html:submit   property= "submit "   value= "Submit "/>
            <html:reset/>

        </html:form> <br>

        <html:img   page= "/struts-power.gif "   alt= "Powered   by   Struts "/>

    </body>
</html:html>

helloaction.java
package   hello;

import   javax.servlet.RequestDispatcher;
import   使用注解的实体类怎么加入到管理hibernate的spring配置文件中