我想將值傳遞給servlet,但我保持空值。JSP doPost getAtribute空值
<jsp:useBean id="Helper" class="model.Registration" scope="request"/>
<form action="/Project/Registration" method="post" enctype="multipart/form-data">
<input type="text" size="20" name="name" value="<%=Helper.getName()%>">
<input type="submit">
</form>
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
Registrationh2 = (Registration) request.getAttribute("Helper");
if(h2!=null){
System. out.println(h2.getName());
}
else
System. out.println("NULL");
}
我的代碼有什麼問題嗎?
嗨,很好的例子謝謝。 – user236501 2010-05-31 01:44:44