Labels

.NET Job Questions About Java Absract class Abstract class Abstract Class and Interface Aggregation ajax aop apache ofbiz Apache ofbiz tutrial Association authentication autocad basics batch Binary Tree bootstrap loader in java build Builder design pattern C++ Job Questions caching CallableStatement in java certifications Chain of responsibility Design pattern charts check parentheses in a string Classes classloader in java classloading concept code quality collage level java program Composition concurrency Concurrency Tutorial Converting InputStream to String Core Java core java concept core java interview questions Core Java Interview Questions Core Java Questions core java tutorial CyclicBarrier in Java data structures database Database Job Questions datetime in c# DB Db2 SQL Replication deserialization in java Design Patterns designpatterns Downloads dtd Eclipse ejb example/sample code exception handling in core java file handling injava File I/O vs Memory-Mapped Filter first program in spring flex Garbage Collection Generics concept in java grails groovy and grails Guice Heap hibernate Hibernate Interview Questions how-to IBM DB2 IBM DB2 Tutorial ide immutable Interceptor Interface interview Interview Questions for Advanced JAVA investment bank j2ee java JAVA Code Examples Java 7 java changes java class loading JAVA Classes and Objects Java Classloader concept Java classloading concept java cloning concept java collection Java collection interview questions Java Collections java concurrency Java CountDownLatch java definiton Java design pattern Java EE 5 Java EE 6 Java Exceptions Java file Java Garbage Collection Java generics Java Glossary java hot concept java immutable concept Java Interface Java interview Question java interview question 2012 java interview question answer Java Interview Questions Java Interview Questions and Answers java interview topic java investment bank Java Job Questions java multithreading java multithreading concept java new features Java Packages java proxy object java questions Java Serialization Java serialization concept java serialization interview question java session concept java string Java Swings Questions java synchronization java threading Java Threads Questions java tutorial java util; java collections; java questions java volatile java volatile interview question Java Wrapper Classes java.java1.5 java.lang.ClassCastException JavaNotes javascript JAX-WS jdbc JDBC JDBC Database connection jdk 1.5 features JDK 1.5 new features Concurrent HashMap JMS interview question JMS tutorial job JSESSIONID concept JSESSIONID interview Question JSF jsp JSP Interview Question JSP taglib JSTL with JSP Junit Junit Concept Junit interview question.Best Practices to write JUnit test cases in Java JVM Linux - Unix tutorial Marker Interfaces MD5 encryption and decryption messaging MNC software java interview question musix NCR java interview question Networking Job Questions news Object Serialization Objects ojdbc14.jar OOP Oracle Oracle SQL Query for two timestamp difference orm own JavaScript function call in Apache ofbiz Packages Palm Apps patterns pdf persistence Portal Portlet Spring Integration Prime number test in java programs Rails Reboot remote computers REST Ruby Sample application schema SCJP security Senior java developer interviews servlet3 servlets session tracking singleton design pattern Spring Spring 2.5 Framework spring ebook Spring framework concept spring MVC spring pdf Spring Security Spring Security interview questions SQL SQL performance SQL Query to create xml file Sql Query tuning ssis and ssrs StAX and XML string concept string immutable string in java strings struts Struts2 Struts2 integration synchronization works in java Technical Interview testing tips Tomcat top Tutorial Volatile in deep Volatile working concept web Web Developer Job Questions web services weblogic Weblogic Application Server websphere what is JSESSIONID xml XML parsing in java XML with Java xslt


Tuesday, 16 July 2013

SCWCD Questions 81- 90


QUESTION NO: 81


Which three are described in the standard web application deployment descriptor? (Choose
three.)
A. session configuration
B. MIME type mappings
C. context root for the application
D. servlet instance pool configuration
E. web container default port bindings
F. ServletContext initialization parameters

Answer: A,B,F


QUESTION NO: 82


Which two are true regarding a web application class loader? (Choose two.)
A. A web application may override the web container's implementation classes.
B. A web application running in a J2EE product may override classes in the javax.* namespace.
C. A web application class loader may NOT override any classes in the java.* and javax.*
namespaces.
D. Resources in the WAR class directory or in any of the JAR files within the library directory may
be accessed using the J2SE semantics of getResource.
E. Resources in the WAR class directory or in any of the JAR files within the library directory
CANNOT be accessed using the J2SE semantics of getResource.

Answer: C,D


QUESTION NO: 83 DRAG DROP


Click the Task button.
Place the corresponding resources and directories in the proper web application deployment
structure.

Answer:


QUESTION NO: 84

You are building JSP pages that have a set of menus that are visible based on a user's security
role. These menus are hand-crafted by your web design team; for example, the SalesManager
role has a menu in the file /WEB-INF/html/sales-mgr-menu.html. Which JSP code snippet should
be used to make this menu visible to the user?
A. <% if ( request.isUserInRole("SalesManager") ) { %>
<%@ include file='/WEB-INF/html/sales-mgr-menu.html' %>
<% } %>
B. <jsp:if test='request.isUserInRole("SalesManager")'>
<%@ include file='/WEB-INF/html/sales-mgr-menu.html' %>
</jsp:if>
C. <% if ( request.isUserInRole("SalesManager") ) { %>
<jsp:include file='/WEB-INF/html/sales-mgr-menu.html' />
<% } %>
D. <jsp:if test='request.isUserInRole("SalesManager")'>
<jsp:include file='/WEB-INF/html/sales-mgr-menu.html' />
</jsp:if>

Answer: A

QUESTION NO: 85

For debugging purposes, you need to record how many times a given JSP is invoked before the
user's session has been created. The JSP's destroy method stores this information to a database.
Which JSP code snippet keeps track of this count for the lifetime of the JSP page?
A. <%! int count = 0; %>
<% if ( request.getSession(false) == null ) count++; %>
B. <%@ int count = 0; %>
<% if ( request.getSession(false) == null ) count++; %>
C. <% int count = 0;
if ( request.getSession(false) == null ) count++; %>
D. <%@ int count = 0;
if ( request.getSession(false) == null ) count++; %>
E. <%! int count = 0;
if ( request.getSession(false) == null ) count++; %>

Answer: A

QUESTION NO: 86

For manageability purposes, you have been told to add a "count" instance variable to a critical
JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which
JSP code snippet must you use to declare this instance variable in the JSP Document?
A. <jsp:declaration>
int count = 0;
<jsp:declaration>
B. <%! int count = 0; %>
C. <jsp:declaration.instance>
int count = 0;
<jsp:declaration.instance>
D. <jsp:scriptlet.declaration>
int count = 0;
<jsp:scriptlet.declaration>

Answer: A

QUESTION NO: 87

In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is
stored as a List object in the catalog attribute of the webapp's ServletContext object. Which
scriptlet code snippet gives you access to the catalog object?
A. <% List catalog = config.getAttribute("catalog"); %>
B. <% List catalog = context.getAttribute("catalog"); %>
C. <% List catalog = application.getAttribute("catalog"); %>
D. <% List catalog = servletContext.getAttribute("catalog"); %>

Answer: C

QUESTION NO: 88

Given the element from the web application deployment descriptor:
<jsp-property-group>
<url-pattern>/main/page1.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
and given that /main/page1.jsp contains:
<% int i = 12; %>
<b><%= i %></b>
What is the result?
A. <b></b>
B. <b>12</b>
C. The JSP fails to execute.
D. <% int i = 12 %>
<b><%= i %></b>

Answer: C

QUESTION NO: 89

You are creating a new JSP page and you need to execute some code that acts when the page is
first executed, but only once. Which three are possible mechanisms for performing this
initialization code? (Choose three.)
A. In the init method.
B. In the jspInit method.
C. In the constructor of the JSP's Java code.
D. In a JSP declaration, which includes an initializer block.
E. In a JSP declaration, which includes a static initializer block.

Answer: B,D,E

QUESTION NO: 90

You are writing a JSP that includes scriptlet code to declare a List variable and initializes that
variable to an ArrayList object. Which two JSP code snippets can you use to import these list
types? (Choose two.)
A. <%! import java.util.*; %>
B. <%! import java.util.List;
import java.util.ArrayList; %>
C. <%@ page import='java.util.List'
import='java.util.ArrayList' %>
D. <%@ import types='java.util.List'
types='java.util.ArrayList' %>
E. <%@ page import='java.util.List,java.util.ArrayList' %>
F. <%@ import types='java.util.List,java.util.ArrayList' %>

Answer: C,E


No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...