I'm trying to send a file with Servlet 3.0/JSP (IDE : Eclipse)
Here my JSP code :
<form method="post" action="UploadServlet"
enctype="multipart/form-data">
Select file to upload: <input type="file" name="file" size="60" /><br />
<br /> <input type="submit" value="Upload" />
</form>
And my Servlet :
@WebServlet
@MultipartConfig(fileSizeThreshold = 1024 * 1024 * 2,
maxFileSize = 1024 * 1024 * 10,
maxRequestSize = 1024 * 1024 * 50)
public class UploadServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final String SAVE_DIR = "uploadFiles";
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException{
//CODE
}
But when i submit my form, i got an error HTTP 404 The requested resource is not available.
Why ?