This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

MultipartRequest cannot be resolved to a type

 
Ranch Hand
Posts: 60
IBM DB2 Eclipse IDE Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to upload an image to database. Prior to that , I am just making the temporary file from where it will be stored in the table.

But I am getting this error.

MultipartRequest cannot be resolved to a type

 
Shounak Kundu
Ranch Hand
Posts: 60
IBM DB2 Eclipse IDE Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are my codes .

1) The JSP file in which I am taking the image input.

 
Shounak Kundu
Ranch Hand
Posts: 60
IBM DB2 Eclipse IDE Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Am not sure if you copied it wrong here- Should the METHOD be not "POST" instead of POST?
 
Marshal
Posts: 67293
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Step 1: move all of the Java code out of the JSP and into a Servlet where it belongs. This is a gross misuse of technology. JSPs are for creating text views like HTML, not processing files.
 
Shounak Kundu
Ranch Hand
Posts: 60
IBM DB2 Eclipse IDE Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


view plaincopy to clipboardprint?

1. <BODY> <FORM ENCTYPE="multipart/form-data" ACTION= "upload.jsp" METHOD=POST> <!-- Is this a typo? Shouldn't it be "POST" -->

<BODY> <FORM ENCTYPE="multipart/form-data" ACTION= "upload.jsp" METHOD=POST> <!-- Is this a typo? Shouldn't it be "POST" -->

Am not sure if you copied it wrong here- Should the METHOD be not "POST" instead of POST?



Actually I was wrong to copy. It is "POST".

So, is there any way out ?
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Shounak Kundu wrote:



I see that you are using some external package- com.oreilly.servlet.* - Do you have this jar in your classpath? And MultipartRequest is mostly from that package.
 
Shounak Kundu
Ranch Hand
Posts: 60
IBM DB2 Eclipse IDE Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I have the jar file in my classpath.

I am using Eclipse editor.
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you paste the complete exception Stack trace?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Shounak Kundu wrote:Hi, I am trying to upload an image to database. Prior to that , I am just making the temporary file from where it will be stored in the table.

But I am getting this error.

MultipartRequest cannot be resolved to a type



I to had the same problem . The problem is jar file. Download from official site http://www.servlets.com/cos/ , hope resolves
 
permaculture is giving a gift to your future self. After reading this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!