File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Format Plain text with HTML tags Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Format Plain text with HTML tags" Watch "Format Plain text with HTML tags" New topic
Author

Format Plain text with HTML tags

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3670

Hi All,

I ran in to an issue where we have a message in plain text and we are supposed to display that in IFrame. We don't have any HTML tags inside the original message. Hence the message doesn't get formatted inside the IFrame. Is there any Yahoo APIs available for this? Or any other APIs you guys have used?

Thanks,


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56221
    
  13

What do you mean by "format plain text"? Seems like a bit of an oxy-moron. If it's formatted, it's not "plain text ", is it?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3670

Thanks Bear.
To the issue, We get emails (Say from Outlook) in to the system, the body is retrieved and have it as a text property (which may consists of spaces, tabs and line break characters). When we display this text message as is in a IFrame (this is a different functionality within the system) it's not formatted since the original text doesn't have any HTML tags etc.. But with a TextArea this works fine. I'm not sure whether this can be done at all yet.

Appreciate your help on this...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56221
    
  13

have you tried making sure that the content type is text/plain? otherwise the browser is probably trying to treat it as HTML.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3670

Have some other issues as well, but will try this also and get back, thanks Bear.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Sounds like someone needs a pre tag.

Eric
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Format Plain text with HTML tags
 
Similar Threads
How can i remove some malicious html tag in user's submit
adding font formatting features to jsp
Convert Html Email to Plain Text
include contents of an .inc file as in HTML pages
Carriage return within a text field