This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to retrieve textbox value in multipart form  RSS feed

 
Greenhorn
Posts: 28
C++ Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had research about this, and their answer is

But I always get null value by using this method.
Any advise?

Index.jsp


upload.jsp


Whenever I am perform the Submit button, the image is uploaded but the txtDesc value always give me a null value.
Thanks for advanced.
 
Author and ninkuma
Marshal
Posts: 66804
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot use the getParameter family of methods with multipart forms.

Are you using a 3rd-party library to process the uploaded form?
 
gah hon
Greenhorn
Posts: 28
C++ Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You cannot use the getParameter family of methods with multipart forms.

Are you using a 3rd-party library to process the uploaded form?





I am using this kind of method to handle the uploaded form as well as the file uploaded.
How to upload file in JSP

What's the any other advise for retrieving the textbox value?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66804
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, don't do it yourself. See the JspFaq for libraries that will do it for you. See http://www.coderanch.com/how-to/java/FileUpload
 
gah hon
Greenhorn
Posts: 28
C++ Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Yes, don't do it yourself. See the JspFaq for libraries that will do it for you. See http://www.coderanch.com/how-to/java/FileUpload



All right, I had apply the approach of using Apache Common FileUpload to retrieve the value of the textbox.
So, I did download and paste the .jar file into the Project's lib and apply the import statement.



Then I am trying the retrieve the value from the textbox.


P/S: Variable desc is declared as global variable.

And the error I got once I execute the program.


Thanks for the future advise.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66804
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have not included all the necessary jar files. The error messages tell you what classes are missing.
 
gah hon
Greenhorn
Posts: 28
C++ Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You have not included all the necessary jar files. The error messages tell you what classes are missing.



Thanks for the guide.
In order to use Apache Common Fileupload approach.
Common-File.Jar & Common-Io.jar must included.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!