• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File output format

 
Ananth Ram
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to open a license file using Servlet in a new browser window. The file opens, but the format is not correct.

Example , input file is as below.


In the browser, the output is as below.
Typically my code in the servlet is below.



Am I missing something on formatting/contentType. Could someone help me out.

Thanks in advance for your help.

Thanks,
Ananth Ram
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's not HTML, why are you saying that it is?

The browser is trying to interpret it as HTML, in which whitespace, such as line-feeds, are ignored.
 
Ananth Ram
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,

So, do you mean I need to specify just text instead of "text/html", or any other options. Please let me know.

Thanks,
Ananth Ram
 
Ananth Ram
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also the file does not have an extension like txt/doc. It is plain. I tried setting to "text/plain", did not work.

Thanks,
Ananth Ram
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
Ananth Ram
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "text/plain" works fine.




Thanks for pointers.

Ananth Ram
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic