Dear Readers, Welcome to JSP Objective Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of JSP MCQs. These objective type JSP questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular question during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.
A. Servlets are built on JSP semantics and all servlets are compiled to JSP pages for runtime usage.
B. JSP and servlets are unrelated technologies.
C. Servlets and JSP are competing technologies for handling web requests. Servlets are being superseded by JSP, which is preferred. The two technologies are not useful in combination.
D. JSPs are built on servlet semantics and all JSPs are compiled to servlets for runtime usage.
A. It allows the JSP to access middleware.
B. It creates a cleaner role separation between the web-production team and the software development team, so that the web-production team can focus on presentation markup, while the software team can focus on building reusable software components for helping to generate dynamic displays.
C. It provides a dynamic markup environment, such that JavaBeans are integrated seamlessly with the template presentation content, in order to create the dynamic display for the client.
D. It provides the developer with full access to the Java 2 Platform Enterprise Edition (J2EE), which is unavailable from outside the JavaBean environment.
A. Redirects are no longer supported in the current servlet API.
B. Redirects are not a cross-platform portable mechanism.
C. The RequestDispatcher does not use the reflection API.
D. The RequestDispatcher does not require a round trip to the client, and thus is more efficient and allows the server to maintain request state.
A. Moving the code into your session manager.
B. Moving the code into scriptlets.
C. Moving the code into JavaBeans and servlets.
D. Moving the code into a transaction manager.
A. Code that deals with logic that is common across requests.
B. Code that deals with logic that is vendor specific.
C. Code that deals with logic that relates to database access.
D. Code that deals with logic that relates to client scope.
A. Lookup the EJBs from within a JSP, but use the EJBs from within a basic JavaBean.
B. Lookup and use the EJBs from a separate business delegate. The JavaBeans that work with JSP pages are clients to these business delegates and know nothing about EJB specifics.
C. Lookup and use the EJBs from within a JSP page, but only as remote references.
D. Lookup the EJBs from within a servlet, delegating usage to specific JSP pages.
A. Yes, but the only tags available relate to database access.
B. No. To iterate over a collection of values, one must use scriptlet code.
C. No, but there is a standard <iterate> tag that may be used.
D. Yes, but custom tags will not help developers create tags for use in iterating over a collection.
A. A JSP page.
B. A JavaBean.
C. A servlet.
D. A session manager.
A. The forward method transfers control to the designated resource, while the include method invokes the designated resource, substitutes its output dynamically in the display, and returns control to the calling page.
B. The two methods provide the same functionality, but with different levels of persistence.
C. The forward method is deprecated as of JSP 1.1 and the include method should be used in order to substitute portions of a dynamic display at runtime.
D. The include method transfers control to a dynamic resource, while the forward method allows for dynamic substitution of another JPS pages output, returning control to the calling resource.
A. <jsp:error page="errorPage.jsp" guard="true" />
B. <%@ page language="java" buffer="8k" %>
C. <jsp:useBean id="bean" class="examples.Bean" scope="request" />
D. <%@ page language="java" errorPage="errorPage.jsp" buffer="8k" %>