Multiple choice technology security

Which methods in the TCS SAPI can be used to prevent Cross Site Scripting Attacks?

  1. isSafeHTML(java.lang.String context, java.lang.String input, boolean allowNull) and encodeForHTML(java.lang.String input)

  2. isSafeHTML(java.lang.String context, java.lang.String input)

  3. SafeHTML(java.lang.String context, java.lang.String input)

  4. ValidHTML(java.lang.String context, java.lang.String input)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To prevent XSS, TCS SAPI uses both isSafeHTML() to validate input and encodeForHTML() to encode it. Validation alone is insufficient - encoding is necessary to neutralize malicious scripts. The correct option A includes both prevention methods.