Skip to content
Sharp

OWASP Vulnerabilities · interview question

Which of the following is a key method to prevent Cross-Site Scripting (XSS) attacks in Java web applications?

Multiple choiceEasychapter-17-curatedpremiumowasp-vulnerabilitiescross-site-scripting-xss
Choose one answer
Answer and explanation

Correct answer

B. HTML Entity Encoding

Why

HTML Entity Encoding converts potentially dangerous characters into their HTML-safe equivalents, preventing the browser from interpreting them as code.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →