Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

[Resolved] Commons Fileupload problem with textarea

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

First of all, I want to say, I've searched on google and on this forum how to solve my problem ; but I didn't find anything that could show me what the issue is caused by.
My problem is very simple: I have a form (in a JSP), that contains some fields. Within this form, I want to upload a file. So I use the commons FileUpload library. I put my fields value in a hasmap in order to access them easily.
This part works fine... except for one field : my textarea.
So I searched on the internet to know if textareas values are not handled by this library, but found nothing

All I've found is some piece of code that explains how to get the file.

Here is the how I map the fields and theirs values:

When I went into debug mode, I saw that the corresponding value of my textarea is empty.
So, I want to ask you: is there a known issue with this library and textarea ? Or did I do something wrong ? Or did I miss something that would explain that textarea should not be supported ? Finally, how can I get the value of this textarea ?

Thanks in advance

EDIT: Woops ! I just saw that I posted this message in the wrong place. i don't know how to apologise : I was searching on this forum about my problem, and started this thread from there.. Thought I was in the right place. I really am sorry. Anyone who can, please move this subject to the right place
Florian Gutierrez
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
God ! how I hate those careless bugs ..

Well, I've found what was wrong: I got 2 fields with the same name .. And in my tests the second was always empty. So when I was settingthe values in the HashMap, the values was first set correctly, then re-written to an empty value.

I figured it out with this :

and saw that the field appears two times

Well, I'm sorry for creating the thread in the wrong place. And I'm sorry for the people who started to search what my problem was.
I'm going to edit the title of this thread to mark it as "Resolved"
Posts: 67430
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Common mistake. Thanks for updating with the solution so others can benefit!
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic