File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache Commons FileUpload isMultipartContent() Deprecated.

 
Alan Blass
Ranch Hand
Posts: 156
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

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
Posts: 959
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you writing Java code in the JSP?!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic