我有这个表格并想处理它:
<form id="myForm" class="form-horizontal" action="/user" method="post">
<fieldset>
<div class="control-group">
<!-- Text input-->
<label class="control-label" for="input01">Email:</label>
<div class="controls">
<input name="email" placeholder="email" class="input-xlarge" type="text"
value="<%=?????????">
</div>
</div>
<div class="control-group">
<!-- Text input-->
<label class="control-label" for="input01">Password:</label>
<div class="controls">
<input name="password" placeholder="password" class="input-xlarge" type="text"
value="<%=request.getParameter("password")%>">
</div>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<input class="btn btn-primary" type='button' value='Save Changes'
onclick='document.forms["myForm"].submit();'>
</div>
</div>
但是,我有一个带有两个参数的 bean 方法,我尝试使用以下方法来处理它:
public void insert(String email, String password) {
User entry = new User(email, password);
PersistenceManager pm = PMF.get().getPersistenceManager();
pm.makePersistent(entry);
}
我的问题是,如何将 Bean 与使用两个参数的表单正确连接?