1
我期待將參數值從我的dojo表單傳遞給Java servlet。我能夠連接到servlet,但我無法提取我的表單的參數。我試圖在我的servlet中檢索我的「appid」的值。請幫忙!將Dojo表單中的表值傳遞給Java servlet
道場表格(form.jsp)
<div dojoType="dijit.form.Form" id="myForm" jsId="myForm" encType="multipart/form-data"
action="UpdateServlet" method="POST">
<table id="newTable">
<tbody><tr>
<td>ID:</td><td><span id="appid" title="ID"><%=app.getId()%></span></td>
</tr>
</tbody>
</table>
<button dojoType="dijit.form.Button" type="submit">
OK
</button>
</div>
UpdateServlet.java
public class UpdateServlet extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
String appId = (String) request.getParameter("appid");
System.out.println("App id is " + appId);
//Appid is null, unable to extract value
response.sendRedirect("index.jsp");
} finally {
out.close();
}
}
}
謝謝!這是我經過多次研究後才發現的。 – newtodatatables 2011-06-14 09:59:05