bluecricket
bluecricket

Reputation: 2042

StringEscapeUtils escapeHtml

Is there a difference between org.apache.commons.lang.StringEscapeUtils.escapeHtml and org.apache.commons.lang3.StringEscapeUtils.escapeHtml4 ?

Upvotes: 5

Views: 10153

Answers (2)

fmpdmb
fmpdmb

Reputation: 1414

Note that StringEscapeUtils.escapeHtml() has issues with apostrophes

Upvotes: 1

P.Nichols
P.Nichols

Reputation: 303

they come from different packages in fact

escapeHtml comes from org.commons.lang (lang 2.5 API) and let's you use a writer object. It can also escape string from an SQL source

escapeHtml4 is from org.commons.lang3 (lang 3.1 API) is specialy use to escape character from a HTML4 source. Nothing more, nothing less

They do the same job but i would recommend using "escapeHtml4" since its from a newer package

See : EscapeHtml4 and escapehtml

Upvotes: 5

Related Questions