Neeraj
Neeraj

Reputation: 11

XSS attacks in jsp

Hi I have a jsp page in which following lines

if(Exception err) {
  out.println (err.getMessage() + "<br/><br/>");
}

may get XSS attacks i want to it just display the above things without any XSS attacks Any thought ?

Upvotes: 1

Views: 2607

Answers (2)

RealHowTo
RealHowTo

Reputation: 35372

Apache Commons provides StringEscapeUtils, see the escapeHtml() method

Upvotes: 0

Jigar Joshi
Jigar Joshi

Reputation: 240900

use c:out tag.

Also See

Upvotes: 3

Related Questions