Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 41

Given an HttpServletRequest request and an EJB SessionContext ctx.

Which is a valid way to retrieve the Principal invoking either behavior?

    Correct Answer: D

    The correct methods to retrieve the Principal from an HttpServletRequest and an EJB SessionContext are request.getUserPrincipal() and ctx.getCallerPrincipal() respectively. The HttpServletRequest method getUserPrincipal() retrieves the Principal associated with the request, while the EJB SessionContext method getCallerPrincipal() retrieves the Principal associated with the EJB invocation.

Discussion
zee2021Option: D

D is the correct syntax and awnser

devmsalehOption: D

D is the correct answer

orjavaOption: D

Answer D