• Post Reply Bookmark Topic Watch Topic
  • New Topic

need help urgently  RSS feed

 
Sridhar Garimella
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
I have one text file which contains formatted data. I am reading that file from Jsp using I/O stream. But the problem is i am loosing the format(i mean no white spaces between words etc). My question is how to read the text file as it is(without loosing the format) from jsp?
Thanks in adavance
Sridhar Garimella
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without seeing any sample code, I'm guessing you are returning the file as the (default) content-type of "text/html". You may be able to solve your problems by setting the content-type to "text/plain".
Dave
 
Matthew X. Brown
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is meant by "formatted"? Java will not save html bold, italics, ect in the characters. Characters are characters- However, the way I've gotten around this is to save the actual html code as well. Like if you write
<b>This is bold</b>
I would get all of it- the <b>'s and all.
 
Matthew X. Brown
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is meant by "formatted"? Java will not save html bold, italics, ect in the characters. Characters are characters- However, the way I've gotten around this is to save the actual html code as well. Like if you write
<b>This is bold</b>
I would get all of it- the <b>'s and all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!