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 121- 130


QUESTION NO: 121


Which three are valid values for the body-content attribute of a tag directive in a tag file? (Choose
three.)
A. EL
B. JSP
C. empty
D. dynamic
E. scriptless
F. tagdependent

Answer: C,E,F


QUESTION NO: 122


The Squeaky Bean company has decided to port their web application to a new J2EE 1.4
container. While reviewing the application, a developer realizes that in multiple places within the
current application, nearly duplicate code exists that finds enterprise beans. Which pattern should
be used to eliminate this duplicate code?
A. Transfer Object
B. Front Controller
C. Service Locator
D. Intercepting Filter
E. Business Delegate
F. Model-View-Controller

Answer: C


QUESTION NO: 123


A developer is designing a web application that makes many fine-grained remote data requests for
each client request. During testing, the developer discovers that the volume of remote requests
significantly degrades performance of the application. Which design pattern provides a solution for
this problem?
A. Flyweight
B. Transfer Object
C. Service Locator
D. Dispatcher View
E. Business Delegate
F. Model-View-Controller

Answer: B


QUESTION NO: 124


In an n-tier application, which two invocations are typically remote, not local? (Choose two.)
A. JSP to Transfer Object
B. Service Locator to JNDI
C. Controller to request object
D. Transfer Object to Entity Bean
E. Controller to Business Delegate
F. Business Delegate to Service Locator

Answer: B,D


QUESTION NO: 125


A developer has created a special servlet that is responsible for generating XML content that is
sent to a data warehousing subsystem. This subsystem uses HTTP to request these large data
files, which are compressed by the servlet to save internal network bandwidth. The developer has
received a request from management to create several more of these data warehousing servlets.
The developer is about to copy and paste the compression code into each new servlet. Which
design pattern can consolidate this compression code to be used by all of the data warehousing
servlets?
A. Facade
B. View Helper
C. Transfer Object
D. Intercepting Filter
E. Composite Facade

Answer: D


QUESTION NO: 126


A developer is designing the presentation tier for a web application which requires a centralized
request handling to complete common processing required by each request. Which design pattern
provides a solution to this problem?
A. Remote Proxy
B. Front Controller
C. Service Activator
D. Intercepting Filter
E. Business Delegate
F. Data Access Object

Answer: B


QUESTION NO: 127


You are designing an n-tier Java EE application. You have already decided that some of your
JSPs will need to get data from a Customer entity bean. You are trying to decide whether to use a
Customer stub object or a Transfer Object. Which two statements are true? (Choose two.)
A. The stub will increase network traffic.
B. The Transfer Object will decrease data staleness.
C. The stub will increase the logic necessary in the JSPs.
D. In both cases, the JSPs can use EL expressions to get data.
E. Only the Transfer Object will need to use a Business Delegate.
F. Using the stub approach allows you to design the application without using a Service Locator.

Answer: A,D


QUESTION NO: 128


You have a simple web application that has a single Front Controller servlet that dispatches to
JSPs to generate a variety of views. Several of these views require further database processing to
retrieve the necessary order object using the orderID request parameter. To do this additional
processing, you pass the request first to a servlet that is mapped to the URL pattern /WEBINF/
retreiveOrder.do in the deployment descriptor. This servlet takes two request parameters, the
orderID and the jspURL. It handles the database calls to retrieve and build the complex order
objects and then it dispatches to the jspURL.
Which code snippet in the Front Controller servlet dispatches the request to the order retrieval
servlet?
A. request.setAttribute("orderID", orderID);
request.setAttribute("jspURL", jspURL);
RequestDispatcher view
= context.getRequestDispatcher("/WEB-INF/retreiveOrder.do");
view.forward(request, response);
B. request.setParameter("orderID", orderID);
request.setParameter("jspURL", jspURL);
Dispatcher view
= request.getDispatcher("/WEB-INF/retreiveOrder.do");
view.forwardRequest(request, response);
C. String T="/WEB-INF/retreiveOrder.do?orderID=%d&jspURL=%s";
String url = String.format(T, orderID, jspURL);
RequestDispatcher view
= context.getRequestDispatcher(url);
view.forward(request, response);
D. String T="/WEB-INF/retreiveOrder.do?orderID=%d&jspURL=%s";
String url = String.format(T, orderID, jspURL);
Dispatcher view
= context.getDispatcher(url);
view.forwardRequest(request, response);

Answer: C


QUESTION NO: 129


You have built a web application that you license to small businesses. The webapp uses a context
parameter, called licenseExtension, which enables certain advanced features based on your
client's license package. When a client pays for a specific service, you provide them with a license
extension key that they insert into the <context-param> of the deployment descriptor. Not every
client will have this context parameter so you need to create a context listener to set up a default
value in the licenseExtension parameter. Which code snippet will accomplish this goal?
A. You cannot do this because context parameters CANNOT be altered programmatically.
B. String ext = context.getParameter('licenseExtension');
if ( ext == null ) {
context.setParameter('licenseExtension', DEFAULT);
}
C. String ext = context.getAttribute('licenseExtension');
if ( ext == null ) {
context.setAttribute('licenseExtension', DEFAULT);
}
D. String ext = context.getInitParameter('licenseExtension');
if ( ext == null ) {
context.resetInitParameter('licenseExtension', DEFAULT);
}
E. String ext = context.getInitParameter('licenseExtension');
if ( ext == null ) {
context.setInitParameter('licenseExtension', DEFAULT);
}

Answer: A


QUESTION NO: 130


You have a use case in your web application that adds several session-scoped attributes. At the
end of the use case, one of these objects, the manager attribute, is removed and then it needs to
decide which of the other session-scoped attributes to remove.
How can this goal be accomplished?
A. The object of the manager attribute should implement the HttpSessionBindingListener and it
should call the removeAttribute method on the appropriate session attributes.
B. The object of the manager attribute should implement the HttpSessionListener and it should call
the removeAttribute method on the appropriate session attributes.
C. The object of the manager attribute should implement the HttpSessionBindingListener and it
should call the deleteAttribute method on the appropriate session attributes.
D. The object of the manager attribute should implement the HttpSessionListener and it should call
the deleteAttribute method on the appropriate session attributes.

Answer: A

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...