0

私はこのフォームを持っていて、それを処理したい:

<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>

ただし、2 つのパラメーターを持つ Bean メソッドがあり、次を使用してこれを処理しようとしました。

public void insert(String email, String password) {
    User entry = new User(email, password);
    PersistenceManager pm = PMF.get().getPersistenceManager();
    pm.makePersistent(entry);
}

私の質問は、Bean を 2 つのパラメーターを使用するフォームに適切に接続する方法です。

4

1 に答える 1