初学JavaBean 使用jsp:getProperty 获取值为空 是怎么回事? 求指教啊

package com.zzj.pojo;

public class User {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}

}

 <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="/JspDay03/jsp/success.jsp" method="POST">
    <table>
        <tr>
            <td>用户名:<input type="text" id="username" class="username"/></td>
            </tr>
        <tr>
            <td>密码:<input type="password" id="password" class="password"/></td>
            </tr>
        <tr>
            <td><input type="submit" value="登录"/></td>  
        </tr>
    </table>

</form>
</body>
</html>

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



Insert title here


接收的数据页面

/jsp:useBean



查看全部
zzj8023888
zzj8023888
2017/08/26 16:21
  • java
  • 点赞
  • 收藏
  • 回答
    私信

2个回复