1个回答
展开全部
<textarea rows="6" cols="60" name="description"></textarea><br/>
大头照:<input type="file" name="image"><br/>
<input type="hidden" name="id" value="12345">
<input type="submit" value="提交">
</form>
public class RequestDemo2 extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String value = request.getParameter("username");
if(value!=null&&!value.trim().equals("")){
System.out.println(value);
}
System.out.println("------------------------------");
Enumeration<String> e = request.getParameterNames();
while(e.hasMoreElements()){
String name = e.nextElement();
value = request.getParameter(name);
System.out.println(name + "="+value);
}
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
}
大头照:<input type="file" name="image"><br/>
<input type="hidden" name="id" value="12345">
<input type="submit" value="提交">
</form>
public class RequestDemo2 extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String value = request.getParameter("username");
if(value!=null&&!value.trim().equals("")){
System.out.println(value);
}
System.out.println("------------------------------");
Enumeration<String> e = request.getParameterNames();
while(e.hasMoreElements()){
String name = e.nextElement();
value = request.getParameter(name);
System.out.println(name + "="+value);
}
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询