Mark works as a Programmer for InfoTech Inc. He develops the following deployment descriptor code.
Which of the following is a valid isUserInRole() method call that can be made if request is the
HttpServletRequest request?
A. request.isUserInRole("Programmer");
B. request.isUserInRole("Manager");
C. request.isUserInRole("Admin");
D. request.isUserInRole("Employee");
You work as a Software Developer for UcTech Inc. You create a session using the HttpSession interface.
You want the attributes to be informed when the session is moved from one JVM to another and also when
an attribute is added or removed from the session. Which of the following interfaces can you use to
accomplish the task?
Each correct answer represents a complete solution. Choose all that apply.
A. HttpSessionBindingListener
B. HttpSessionListener
C. HttpSessionActivationListener
D. HttpSessionAttributeListener
Which of the following fields must be present in the login page when using the form-based authentication? Each correct answer represents a part of the solution. Choose two.
A. j_login
B. j_password
C. get_pw
D. j_pw
E. j_username
F. user_pw
Which of the following methods must be implemented by each subclass of the Permission class to compare permissions?
A. hashcode
B. implies
C. newPermissionCollection
D. equals
Which of the following options are available with jar files? Each correct answer represents a complete solution. Choose all that apply.
A. M - Deletes an existing manifest file
B. c - Creates a jar file
C. o - Overrides an existing jar file
D. 0 - Stores a file without using zip compression
E. m - Manipulates or updates an existing jar file
F. u - Unzips a jar file
G. M - Creates a manifest file
Which of the following statements are correct about the code given below?
Each correct answer represents a complete solution. Choose all that apply.
A. The delete http method is not allowed in the http-method element declaration.
B. If no http-method is specified in the web-resource-collection element, the security restriction will be applied to all http methods.
C. There should be at-least one url-pattern element otherwise, the
D. It is necessary that the web-resource-name must be specified in the web-resource-collection element.
E. It is not possible to define more than two http method in the web-resource-collection element.
F. It is necessary that the web-resource-name must be specified in the url of the url-pattern element.
Which of the following classes implements the java.lang.Cloneable and java.lang.Runnable interfaces correctly?
A. public class DemoThread implements Runnable, Cloneable {public void run() { /* some code here */ } protected boolean clone() throws CloneNotSupportedException { /* some code here */ }. . . .}
B. public class PrintData implements Runnable, Cloneable {public void run() { /* some code here */ } protected Object clone() throws CloneNotSupportedException { /* some code here */ }. . . .}
C. public class CloneCheck implements Runnable, Cloneable {public int run() { /* some code here */ } public Object clone() throws CloneNotSupportedException { /* some code here */ }. . . .}
D. public class Demo implements Runnable, Cloneable {public void run() { /* some code here */ }. . . .}
Which of the following data type values is returned by the System.in.read() console input function?
A. String
B. Integer
C. Float
D. Character
Which of the following CLDC connector modes is used only for data input over a connection?
A. READ_WRITE
B. READ
C. WRITE
Which of the following keywords is used to throw an exception object inside a method?
A. throw
B. catch
C. final
D. throws
E. finally
F. assert