File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Apache Commons FileUpload isMultipartContent() Deprecated. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Apache Commons FileUpload isMultipartContent() Deprecated." Watch "Apache Commons FileUpload isMultipartContent() Deprecated." New topic

Apache Commons FileUpload isMultipartContent() Deprecated.

Alan Blass
Ranch Hand

Joined: Mar 21, 2010
Posts: 151

I am using Apache Commons FileUpload and I am trying to to determine if it is multipart.

I am using netbeans and netbeans has crossed out the isMultipartContent, meaning it is deprecated. I pressed CTRL-SPACE and javadocs shows another method:

public static final boolean isMultipartContent(RequestContext ctx)

How should I use RequestContext in my JSP file? What should I enter as the argument for isMultipartContent?

Thanks for your help.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

The ServletFileUpload.isMultipartContent(javax.servlet.http.HttpServletRequest) isn't deprected, but the FileUploadBase.isMultipartContent(javax.servlet.http.HttpServletRequest) is. Since the method is a static method, I think you still can use the ServletFileUpload.isMultipartContent(javax.servlet.http.HttpServletRequest).

From the javadocs

Use the method on ServletFileUpload instead.

SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
David Newton

Joined: Sep 29, 2008
Posts: 12617

Why are you writing Java code in the JSP?!
I agree. Here's the link:
subject: Apache Commons FileUpload isMultipartContent() Deprecated.
It's not a secret anymore!