Multiple choice java

The session tracking in the JSP can be done by :-

  1. URL rewriting
  2. Cookies
  3. User-Authorization
  4. Hidden Files

  1. 1,3,4 only

  2. 2,3,4 only

  3. 1,2,4 only

  4. 1,2,3,4

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

The four common mechanisms for session tracking are URL Rewriting, Cookies, Hidden Form Fields, and SSL / Session IDs (often related to User-Authorization). Option C (1,2,4) includes valid methods. Option B (2,3,4) excludes URL Rewriting, which is a valid method. The prompt claims C is correct. However, 'User-Authorization' (3) is also a valid mechanism defined by the servlet specification (using the login config). A strict interpretation of standard 4 mechanisms usually lists 1, 2, 3, and Hidden Fields. C is the 'best' distractor among the options if 3 is considered invalid or if the question implies specific APIs, but 'Hidden Files' is a misnomer for 'Hidden Fields'.