| ADVANCE JAVA (3360701) |
282) What Programing Language or Scripting Language does java server pages (JSP) Supports?
A. Java Script
B. VB Script
C. Java
D. All of above are supported.
Answer: C
283) A JSP Page is transformed into
A. Java Applet
B. Java Servlet
C. Either 1 or 2 Above.
D. Neither 1 or 2 Above.
Answer: B
284) What JSP stands for?
A. Java Service Programming
B. Java Server Programming
C. Java Service Pages
D. Java Server Pages
Answer: C
285) Which of the following do not supports JSP directly?
A. Web logic Server
B. Web Sphere Server
C. Tomcat Server
D. Apache HTTP Server
Answer : D
286) All jsp pages are required to be mapped and configured in web.xml.
A. True
B. False
Answer : A
287) Which of the following is a server side technology?
A. Html
B. jsp
C. JavaScript
D. css
Answer : B
288) Which of the following is not a valid attribute of a page directive?
A. Language
B. Extend
C. Export
D. Import
Answer : C
289) Which of the following is not a directive?
A. Include
B. Page
C. Export
D. UseBean
Answer : C
290) _jspService() method of HttpJspPage class should not be overridden.
A. True
B. False
Answer : A
291) What is the correct signature of _jspService() method of HttpJspPage class?
A. void _jspService(HTTPRequest request, HTTPResponse response)
B. void _jspService(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
C. void _jspService()
D. void _jspService() throws ServletException, IOException
Answer : B
292) What is the correct signature of jspInit() method of HttpJspPage class?
A. void jspInit(HTTPRequest request, HTTPResponse response)
B. void jspInit(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
C. void jspInit()
D. void jspInit() throws ServletException, IOException
Answer : C
293) What is the correct signature of jspDestroy() method of HttpJspPage class?
A. void jspDestroy(HTTPRequest request, HTTPResponse response)
B. void jspDestroy(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
C. void jspDestroy()
D. void jspDestroy() throws ServletException, IOException
Answer : C
294) What is the correct signature of _jspService() method of HttpJspPage class?
A. void _jspService(HTTPRequest request, HTTPResponse response)
B. void _jspService(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
C. void _jspService()
D. void _jspService() throws ServletException, IOException
Answer : B
295) Which page directive should be used in JSP to generate a PDF page?
A. contentType
B. generatePdf
C. typePDF
D. contentPDF
Answer : A
296) Which of the following is true about Initialization phase in JSP life cycle?
A. When a container loads a JSP it invokes the jspInit() method before servicing any requests.
B. Container invokes _jspService () method during Initialization phase.
C. Both of Above
D. None of Above
Answer : A
297) Which tag should be used to pass information from JSP to included JSP?
A. Using <%jsp:page> tag
B. Using <%jsp:param> tag
C. Using <%jsp:import> tag
D. Using <%jsp:useBean> tag
Answer : A
298) Default value of autoFlush attribute is?
A. True
B. False
Answer : A
299) Which one is the correct order of phases in JSP life cycle?
A. Initialization, Cleanup, Compilation, Execution
B. Initialization, Compilation, Cleanup, Execution
C. Compilation, Initialization, Execution, Cleanup
D. Cleanup, Compilation, Initialization, Execution
Answer : C
300) Which technology do we mix our business logic with the presentation logic?
A. Servlet
B. JSP
C. Both A & B
D. None of the above
Answer : A
301) Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
A. The ErrorPage Attribute
B. The IsErrorPage Attribute
C. Both A & B
D. None of the above
Answer : A
302) The ASP and JSP technologies are quite similar in the way they support the creation of Dynamic pages, using HTML templates, scripting code and components for business logic.
A. True
B. False
Answer : A
303) Which can generate HTML dynamically on the client but can hardly interact with the web server to perform complex tasks like database access and image processing etc. in JSP?
A. vs.Static HTML
B. vs.Server-Side Includes
C. vs.Pure Servlets
D. Vs.JavaScript
Answer : D
304) Which tag is used to execute java source code in JSP
A. Declaration Tag
B. Scriptlet tag
C. Expression tag
D. None of the above
Answer : B
305) Which two interfaces does the javax.servlet.jsp package have?
A. JspPage
B. HttpJspPage
C. JspWriter
D. PageContext
E. Both A & B
Answer : E
306) Which of the following is an advantage of the statement – Separation of business logic from JSP ?
A. Custom Tags in JSP
B. JSP Standard Tag Library
C. All the above
D. None of the above
Answer : A
307) JSPs eventually are compiled into Java servlets, you can do as much with JSPs as you can do with Java servlets.
A. True
B. False
Answer : A
308) How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
A. 8
B. 9
C. 10
D. 7
Answer : B
309) JavaServer Pages often serve the same purpose as programs implemented using the Common Gateway Interface (CGI)
A. True
B. False
Answer : A
310) Which JSP Action tags is used to include the content of another resource, it may be jsp, html or servlet?
A. jsp:include
B. jsp:forward
C. jsp:plugin
D. jsp:papam
Answer : A
311) In JSP how many ways are there to perform exception handling?
A. 3
B. 2
C. 4
D. 5
Answer : B
312) In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?
A. import
B. Content Type
C. Extends
D. Info
Answer : B
313) A JSP page consists of which tags?
A. HTML tags
B. JSP tags
C. Both A & B
D. None of the above
Answer : C
314) Which packages does a JSP API consist of?
A. javax.servlet.jsp
B. java.servlet
C. javax.servlet.jsp.tagext
D. Both A & C
Answer : D
315) Which of the following attributes are mandatory in <jsp:setProperty /> tag?
A. name, property
B. type, id
C. name, type
D. id, property
Answer : A
316) Which of the following is an implicit object?
A. pageContext
B. servletContext
C. httpContext
D. sessionContext
Answer : A
317) out is instance of which class?
A. javax.servlet.jsp.JspWriter
B. javax.servlet.jsp.PringWriter
C. javax.servlet.Writer
D. javax.servlet.jsp.Writer
Answer : A
318) What is the default value of isScriptingEnabled attribute?
A. True
B. False
Answer : A
319) Which of the following is true about <jsp:forward> action?
A. The forward action terminates the action of the current page.
B. The forward action forwards the request to another resource such as a static page, another JSP page, or a Java Servlet.
C. Both of the above.
D. None of the above.
Answer : C
320) Can you make use of a ServletOutputStream object from within a JSP page?
A. True
B. False
Answer : B
321) Which of the following is true about <c:forEach > tag?
A. The <c:forEach > exists as a good alternative to embedding a Java for, while, or do- while loop via a scriptlet.
B. The <c:forEach > is used to iterate over a list of items in jsp.
C. Both of the above.
D. None of the above.
Answer: C
322) What is default value of autoFlush Attribute?
A. True
B. False
Answer : A
323) Which of the scripting of JSP not putting content into service method of the converted servlet?
A. Declarations
B. Scriptlets
C. Expressions
D. None of the above
Answer : C
324) The difference between Servlets and JSP is the …………….
A. translation
B. compilation
C. syntax
D. Both A and B
Answer : C
325) JSP includes a mechanism for defining………………………………… or custom tags.
A. static attributes
B. local attributes
C. dynamic attributes
D. global attributes
Answer : C
326) Which of the following are the valid scopes in JSP?
A. request, page, session, application
B. request, page, session, global
C. response, page, session, application
D. request, page, context, application
Answer : A
327) Why DB connections are not written directly in JSPs?
A. Response is slow
B. Not a standard J2EE architecture
C. Load Balancing is not possible
D. Both B and C
Answer : D
328) How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
A. 8
B. 9
C. 10
D. 7
Answer : B
329) Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
A. The ErrorPage Attribute
B. The IsErrorPage Attribute
C. Both A & B
D. None of the above
Answer: A
330) Which http method send by browser that asks the server to get the page only?
A. get
B. post
C. option
D. put
Answer: A
331) Which can generate HTML dynamically on the client but can hardly interact with the web server to perform complex tasks like database access and image processing etc. in JSP?
A. vs.Static HTML
B. vs.Server-Side Includes
C. vs.Pure Servlets
D. Vs.JavaScript
Answer: D
332) Which of the following statements is true regarding the scope of ‘request’ in JSP?
A. 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 run time, the object is still reachable
C. References to objects with request scope are stored in the request object
D. All of the above
Answe : D
333) Can be extend JSP technology?
A. True
B. False
Answer : A
334) What is media type of JSP?
A. application/jsp
B. text/javax
C. java/jsp
D. java/text
Answer :A
335) In JSP config is instance of which class?
A. javax.servlet.ServletContext
B. javax.servlet.ServletConfig
C. javax.servlet.Context
D. javax.servlet.Application
Answer : B
336) For What JSP is used?
A. Server-side dynamic content generation
B. Client Side language for validation
Answer :A
337) What is the default value of isScriptingEnabled attribute?
A. True
B. False
Answer : A
338) Which of the following is true about <jsp:getProperty> action?
A. The getProperty action gets the properties of a bean.
B. The getProperty action converts the property of a bean to a string, and finally inserts it into the output.
C. Both of the above.
D. None of the above.
Answer : C
339) All servlet classes are required to be mapped and configured in web.xml.
A. True
B. False
Answer : A
340) What is Full form of JSTL?
A. JSP Tag Library
B. JavaServer Pages Standard Tag Library
C. Java Standard Tag Library
D. None of the above.
Answer : B
341) Which of the following do not supports JSP directly?
A. Weblogic Server
B. Apache HTTP Server
C. WebSphere Server
D. Tomcat Server
Answer : B
342) Which method of the Component class is used to set the position and size of a component in JSP?
A. setPosition()
B. setSizePosition()
C. setBounds()
D. etSize()
Answer : C
343) What is the use of <c:if> tag?
A. It is used to check if jsp tag library is enabled or not.
B. It evaluates an expression and displays its body content only if the expression evaluates to true.
C. Both of the above.
D. None of the above.
Answer : B
344) What alternatives exist to embedding Java code directly within the HTML markup of your JSP page?
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.
Answer : C
345) All the data is kept at the application server data is kept at the web server?
A. dynamic, static
B. static, dynamic
C. HTML, Servletwrong
D. Servlet, HTML
Answer : A
346) Are custom tags available in JSP 1.0? If not, how else might you implement iteration from within a JSP?
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 tag that may be used.
D. Yes, but custom tags will not help developers create tags for use in iterating over a collection.
Answer : B
347) What programming language(s) or scripting language(s) does Java Server Pages (JSP) support?
A. VB Script
B. Java only
C. Any Programming Lanuage Code
D. Java Script
Answer: B
348) JavaServer Pages are processed by?
A. JSP Container
B. The asp.dll component
C. IIS
D. Web Server
Answer: A
349) In JSP, a Canvas object provides access to a Graphics object via one of its method called:
A. getCanvas()
B. paint()
C. getPaint()
D. getGraphics()
Answer: B
350) Choose an incorrect statement from the following.
A. JSP pages are easier to maintain than a servlet.
B. The Web Container translate a Servlet into JSP page.
C. JSP is built on Java Technology so it is platform independent.
D. A JSP page seperates presentation and business logic.
Answer: B
351) Which method in JSP is used to perform cleanup ?
A. jspDestroy()
B. destroy()
C. _jspDestroy()
D. jsp_Destroy()
Answer: A