Adding Code for BAEL-394 (#1163)
* Code for evaluation article Article : Field vs. Constructor Injection * Correct typo in attribute name * Delete EbookRepositiry.java * Add corrected class * Update LibraryUtils.java * Update Member.java * Update Reservation.java * Adding new file AccountServlet * Adding new files for BAEL-394 * Add new files for BAEL-394 * Add new file for BAEL-394 * Indentation of annotations fixed * Indentation of annotations fixed * Indentation of annotations fixed * Removing this class since it is not relevant * New example added for @WebListener
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.baeldung.javaeeannotations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.MultipartConfig;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.Part;
|
||||
|
||||
@WebServlet(urlPatterns = { "/uploadCustDocs" })
|
||||
@MultipartConfig(
|
||||
fileSizeThreshold = 1024 * 1024 * 20,
|
||||
maxFileSize = 1024 * 1024 * 20,
|
||||
maxRequestSize = 1024 * 1024 * 25,
|
||||
location = "D:/custDocs"
|
||||
)
|
||||
public class UploadCustomerDocumentsServlet extends HttpServlet {
|
||||
|
||||
protected void doPost(
|
||||
HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
for (Part part : request.getParts()) {
|
||||
part.write("myFile");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user