大神帮我看看为什么servlet中不能打印出来前台: <form action="/UploadServlet" method="post" enctype="multipart/form-data"> 请选择图片:<input id="myfile" name="myfile" type="file"> <input type="submit" value="上传"> </form>web.xml: <servlet> <servlet-name>UploadServlet<servlet-name> <servlet-class>com.imooc.servlet.UploadServlet<servlet-class> <servlet> <servlet-mapping> <servlet-name>UploadServlet<servlet-name> <url-pattern>/UploadServlet</url-pattern> <servlet-mapping>servlet: protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // TODO Auto-generated method stub System.out.println("已接收到请求"); }
1 回答
按照自己的节奏前行
TA贡献90条经验 获得超70个赞
<form action="这里/UploadServlet" method="post" enctype="multipart/form-data"> 请选择图片:<input id="myfile" name="myfile" type="file"> <input type="submit" value="上传"> </form> <!-- 加上你的项目名字路径-->
添加回答
举报
0/150
提交
取消