Which of the following elements are the subelements of the mime-mapping element in a deployment descriptor file?
Each correct answer represents a complete solution. Choose all that apply.
Aexception-type
Berror-code
Cextension
Dmime-type
Eservlet-class
Which directory in JAR files is used to store package and extension configuration data?
AMETA-INF
BGAMMA-INF
CZIP-INF
DTAR-INF
Which of the following are valid thread state transitions?
Each correct answer represents a complete solution. Choose all that apply.
AFrom running to ready.
BFrom ready to waiting.
CFrom running to waiting.
DFrom waiting to ready.
EFrom ready to running.
FFrom waiting to running.
In which of the following cases is the GET method used to retrieve information?
Each correct answer represents a complete solution. Choose all that apply.
AUsing a hyperlink inside a Web page.
BUsing a form with no method definition.
CAdding the request parameter to the URL.
DRequesting to retrieve a large amount of data.
Which of the following code is used to create an object of security manager?
Which of the following methods returns a Cipher object that implements the specified transformation?
AgetCallerIdentity()
BgetObject()
CgetHeader()
DgetInstance()
Which of the following is a mandatory sub-element of the <web-resource-collection> element of the deployment descriptor?
A <web-resource-name>
B <description>
C <http-method>
D <url-pattern>
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
AStringBuffer is thread safe, but StringBuilder is not.
BThe String class is final.
CStringBuilder offers faster performance than StringBuffer.
DThe size of the String can be obtained using the length property.
The following JSP scriptlet is given.
<% response.setContentType("text/html; charset=ISO-8859-1"); %>
Which of the following directives is the equivalent directive for the scriptlet given above?
A<%@ include contentType="text/html; pageEncoding=ISO-8859-1" %>
B<%@ include contentType="text/html; charset=ISO-8859-1" %>
Given below are top-level class declarations. Which of these class declarations would not produce a compile-time error? abstract class P //1 private class Q //2 static class R //3 transient class S //4
ALine 3
BLine 1
CLine 2
DLine 4
Which of the following statements about the <auth-constraint> element are true?
Each correct answer represents a complete solution. Choose all that apply.
AIt is an optional sub-element of the <security-constraint> element.
BIt has <role-name> and <role-type> as its sub-elements.
CIf the <auth-constraint> element is not present, all users can access the resource.
DIf the <auth-constraint> element has no <role-name> sub-element, all users can access the resource.
Which of the following methods is used to authenticate the users, and if the user has not been authenticated, the method returns false?
AgetCallerPrincipal()
BgetRemoteUser()
CisUserInRole()
DgetCallerIdentity()
Which of the following mechanisms is closely related to authorization?
ASending data so that no one can alter it on the way.
BAllowing access to a particular resource.
CVerifying username and password.
DSending secret data such as credit card information.
You work as a Programmer for InfoTech Inc. You develop two html pages named authenticate.jsp and error.jsp, which are deployed directly at the root of the Web application named Authentication. Which of the following deployment descriptor code declarations will be used to ensure that the error.jsp page will be displayed automatically if the client is not authenticated?
Which of the following are advantages of client-side JavaScript?
Each correct answer represents a complete solution. Choose two.
AIt is fast.
BIt provides graphical components.
CIt is secure.
DIt provides form-validation at client side.
You work as a Software Developer for NewTech Inc. You want to configure the deployment descriptor so as to specify the error pages used in the FORM based authentication. Which of the following elements will you use to accomplish the task?
AThe <realm-name> sub-element of the <login-config> element.
BThe <role-link> sub-element of the <security-role-ref> element.
CThe <method> sub-element of the <method-permission> element.
DThe <form-login-config> sub-element of the <login-config> element.
Mark works as a Programmer for InfoTech Inc. He develops a class named Data that imports all the required packages. The class Data uses a method named PrintData(), which uses a method that checks whether the caller has a BeanUser security role. Which of the following code of the method PrintData() will satisfy the requirement?
Apublic void PrintData(){@DeclareRoles("BeanUser")@Resource SessionContext ctx;@RolesAllowed("BeanUser")Principal caller = ctx.getCallerPrincipal();if (ctx.getCallerIdentity("BeanUser")) {System.out.println("It is the correct user");}else{System.out.println("It is the incorrect user");}//more code}
Bpublic void PrintData(){@DeclareRoles("BeanUser")@Resource SessionContext ctx;@RolesAllowed("BeanUser")Principal caller = ctx.getEJBHome();if (!isCallerInRole(ctx)) {System.out.println("It is the correct user");} else{System.out.println("It is the incorrect user");}//more code}
Cpublic void PrintData(){@DeclareRoles("BeanUser")@Resource SessionContext ctx;@RolesAllowed("BeanUser")Principal caller = ctx.getCallerPrincipal();if (ctx.isCallerInRole("BeanUser")) {System.out.println("It is the correct user");}else{System.out.println("It is the incorrect user");}//more code}
Dpublic void PrintData(){@DeclareRoles("BeanUser")@Resource SessionContext ctx;@RolesAllowed("BeanUser")Principal caller = ctx.getCallerPrincipal();if (ctx.getStatus("BeanUser")) {System.out.println("It is the correct user");} else{System.out.println("It is the incorrect user");}//more code}
Which of the following methods can be invoked from the ejbStore() method of an entity bean class?
Each correct answer represents a complete solution. Choose all that apply.
AgetPrimaryKey()
BgetUserTransaction()
CgetRollbackOnly()
DisCallerInRole()
EgetEJBObject()
Harry works as a Software Developer for SoftTech Inc. He has developed a Java application to perform various SQL statements such as INSERT, UPDATE, etc., against a database table named Employee. He has used the executeUpdate() method to perform various SQL queries and to know the exact affected rows in the database if any of the operations is performed against the database table.
Which of the following types of values is returned by this method?
ADouble
BInteger
CFloat
DString
DRAG DROP -
Drag and drop the appropriate authentication types from the given options to match their properties.