This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to retrieve textbox value in multipart form  RSS feed

 
gah hon
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
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: 66142
141
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: 66142
141
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!