user1993469
user1993469

Reputation: 71

Data type for a HTML Page in JAVA

Which data type should be used to store an HTML page in JAVA?

Upvotes: 0

Views: 1817

Answers (2)

ollo
ollo

Reputation: 25370

Recommendation: Store the page in a (Jsoup) Document.

pros:

  • you can parse those documents from string / file / website in a single line
  • all entities are escaped (and can be unescaped)
  • pretty printing
  • you get a string out of it with a single line of code - a html string as well as a text only one
  • you can easily select / modify your html
  • html is "cleaned"
  • ...

see: http://jsoup.org/

But some more informations about what you want to do would be helpful ...

Upvotes: 1

ratlan
ratlan

Reputation: 351

Without knowing what you will do with it, I'd suggest a

java.lang.String

because that's what it actually is. A character string.

Upvotes: 0

Related Questions