-2

I would like to create a Java Servlet to allow an Android device to post photos. Where should I begin? Should I use the Apache common fileupload library?

I know how to create a servlet, basically like this right:

@WebServlet(name = "UploadServlet")
public class UploadServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}

(I'm new to Java and web development.)

1
  • Tks for the question redirect. Commented Apr 14, 2013 at 8:00

1 Answer 1

2

It seems you're using Servlet API 3.0, so there is a dedicated annotation for tagging methods which manage file upload: javax.servlet.annotation.MultipartConfig.

A good tutorial / example is How to write upload file servlet with Servlet 3.0 API.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.