This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Does File Uploading in Struts ignore Tab characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Does File Uploading in Struts ignore Tab characters" Watch "Does File Uploading in Struts ignore Tab characters" New topic
Author

Does File Uploading in Struts ignore Tab characters

sravani jetty
Ranch Hand

Joined: Jun 06, 2007
Posts: 38
Hi,

I am uploading a Tab delimited file and I am using below code to get the file



And I am using below code to read the file and parse data



String tokenizer length returns me one

The file I am uploading contains the below data

ABC DEF GHI 123 qwe

I have tab space between these columns.

When i break the string using String Tokenizer using "\t" it returns me the entire line without breaking it. I wrote a plain java class and tested this which works fine so I think is there any issue with FormFile in struts that just ignores tab spaces.

Any suggestions are much appreciated

Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Check the request that's actually being sent (like with Firebug or a proxy etc.) -- I'm skeptical that the file contents would be modified by struts or commons-fileupload, but I suppose it's possible.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Does File Uploading in Struts ignore Tab characters