-
Which of the following statements correctly define the use of Servlet over CGI (Multiple choice)
Skill/Topic: ServletsA) Servlet provide a way to generate dynamic documents that is both easier to write and faster to run. B) Servlet also address the problem of doing server-side programming with platform-specific APIsC) They are developed with the Java Servlet API, a standard Java extensionD) They have slower response
-
State true or false -- Without using frames we can have a vertical scrollbar with a jsp which in turn is part of other jsp. ?
Skill/Topic: Programming ConstructsA) TrueB) FalseExplanation: use the div tag.
-
The information needed to create a TCP socket for communication in JSP is (Multiple choice)
Skill/Topic: Programming ConstructsA) The Local Systems IP Address B) Local Systems Port Number C) Remote System’s IPAddress D) Remote System’s Port Number.
-
-
Which of the following statements is true regarding the access to the information provided by the ServletContext
Skill/Topic: Programming ConstructsA) Information such as the names of the parameters passed in by the client, the protocol (scheme) being used by the client, B) The names of the remote host that made the request and the server that received it. C) Also the input stream, as ServletInputStream.Servlets use the input stream to get data from clients that use application protocols such as the...
-
JSP is the Java platform technology for building applications containing dynamic web contents such as (Multiple choice)
Skill/Topic: FundamentalsA) XHTML B) XML C) DHTML D) HTML
-
Which of the following tools can be used to stress test the Servlet 1. JMeter from Apache 2. Mercury LoadRunner
Skill/Topic: FundamentalsA) 1 only B) 2 only C) 1,2 both D) Neither 1 nor 2.
-
-
Which of the following statements is true (Multiple choice)
Skill/Topic: FundamentalsA) application interface refers to the webapplication environment B) session interface refers to the user session C) request interface refers to the request page D) response interface refers to the response page
-
State true or false -- HttpSession.setMaxInactiveInterval() can manage the inactivity lease period on a per-session basis.
Skill/Topic: FundamentalsA) TrueB) FalseExplanation: Typically, a default inactivity lease period for all sessions is set within your JSP engine admin screen or associated properties file. However, if your JSP engine supports the Servlet 2.1 API then the above feature is supported.
-
State true or false :- There exists a direct API in JSP to verify that the browser accepted the cookie?
Skill/Topic: JSP ConnectionsA) TrueB) FalseExplanation: But the quick alternative would be, after sending the required data to the users browser, redirect the response to a different Servlet which would try to read back the cookie. If this Servlet is able to read back the cookie, then it was successfully saved, else user had disabled the option to accept cookies
-
Arguments can be passed to the Servlet in the following ways (Multiple choice)
Skill/Topic: JSP ConnectionsA) Using name/value pairs in the URL B) Providing the details in the conf/web.xml files C) Using param name construct. D) None of the above
-
Fill in the blanks -- Sharing of session data across multiple load balanaced web servers is called _____________
Skill/Topic: Session HandlingA) ClusteringExplanation: IBM websphere and JRun(From version 3.0) supports this concepts.
-
State true or false -- If the session object is invalidated can it be again regained or refreshed
Skill/Topic: Session HandlingA) TrueB) FalseExplanation: Not because once it is invalidated then it is garbage collected.
-
Which of the following statements is true regarding the scope of ‘page’ in JSP
Skill/Topic: JSP Life CycleA) Objects with page scope are accessible only within the page where they are created.B) References to objects with page scope are stored in the pagecontext objectC) All references to such an object shall be released after the response is sent back to the client from the JSP page or the request is forwarded somewhere else.D) All of the above.
-
Which of the following statements is true regarding the scope of ‘request’ in JSP ?
Skill/Topic: JSP Life CycleA) Objects with request scope are accessible from pages processing the same request where they were created.B) All references to the object shall be released after the request is processed; in particular, if the request is forwarded to a resource in the same runtime, the object is still reachable.C) References to objects with request scope are stored in the request object.D)...
-
Which of the following statements is true about the scope of ‘application’ in JSP ? (Multiple choice)
Skill/Topic: JSP Life CycleA) Objects with application scope are accessible from pages processing requests that are in the same application as they one in which they were created. B) All references to the object shall be released when the runtime environment reclaims the ServletContext. C) Objects with application scope can be defined (and reached) from pages that are not session-awareD) References...
-
The maximum length of the session Id(length identifier) is ___________
Skill/Topic: JSP Life CycleA) 4KExplanation: 4096 bytes
-
Which of the following correctly describes the sequence of calling the methods for preventing browser from catching the datai. response.setHeader("Cache-Control","no-store"); ii. response.setHeader("Pragma","no-cache"); iii.response.setDateHeader ("Expires", 0);
Skill/Topic: JSP Life CycleA) i,ii,,iiiB) iii,i,iiC) i,ii,iiiD) ii,iii,i
-
Which of the options correctly defines the methods in the HttpServelet class are (Multiple choice):-
Skill/Topic: ServletsA) protected void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException B) protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException C) protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException D) protected void...
JSP Interview Questions
Ans