GSSP-Java practice questions, page 10 of 11, with answer review and explanations.
Question 46
Which of the following methods belongs to the FilterConfig interface and ServletConfig interface both? Each correct answer represents a complete solution. Choose all that apply.
getInitParameter()
getServletContext()
getFilterName()
getInitParameterNames()
Question 47
You work as a Software Developer for UcTech Inc. You want to use form-based authentication as a security mechanism in your application. Which of the following entries will you use in your login page to accomplish the task? Each correct answer represents a part of the solution. Choose all that apply.
j_pw
j_security_check
password
_jid
j_username
j_password
jid
j_un
Question 48
Mark works as a Programmer for InfoTech Inc. He develops a session bean class named accountService. Which of the following rules must be conformed by the session bean class? Each correct answer represents a complete solution. Choose all that apply.
It can be used without the @Stateful or @Stateless annotation.
It must implement the business methods defined in the business interface.
It can implement any optional business method annotated by the @Remove annotation.
It must have a public constructor that takes a string as its parameter.
It requires helper classes to meet the needs of an application.
Question 49
Which of the following methods performs the authentication of subject and, if successful, associates Principals and Credentials with the authenticated Subject?
The getSubject() method of the LoginContext class
The login() method of the LoginModule interface
The login() method of the LoginContext class
The initialize() method of the LoginModule class
Question 50
What will be the output of the following program? class Stringtest { public static void main(String args[]) { String s= "test"; s.concat("paper"); System.out.println(s); } }