Quiz
JSP
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (100)
1Which of the following is true about Initialization phase in JSP life cycle?
- AWhen a container loads a JSP it invokes the jspInit() method before servicing any requests.
- BContainer invokes _jspService() method during Initialization phase.
- CBoth of the above.
- DNone of the above.
2What JSTL stands for?
- AJavaServer Pages Standard Tag Library
- BJSP Tag Library
- CJava Standard Tag Library
- DNone of the above.
3What is the use of <c:remove > tag?
- AIt removes a item from a list
- Bit removes the data row from the database.
- CIt removes a variable from either a specified scope or the first scope where the variable is found
- DNone of the above.
4Setting isThreadSafe false can lead to poor performance.
- ATrue
- BFalse
5How to pass information from JSP to included JSP?
- AUsing <%jsp:param> tag.
- BUsing <%jsp:page> tag.
- CUsing <%jsp:import> tag.
- DUsing <%jsp:useBean> tag.
6Which of the following is true about <jsp:getProperty> action?
- AThe getProperty action gets the properties of a bean.
- BThe getProperty action converts the property of a bean to a string, and finally inserts it into the output.
- CBoth of the above.
- DNone of the above.
7What will happen if isELIgnored attribute is set as false?
- AExpression Language (EL) expressions will not be evaluated and will be treated as static text.
- BJSP container will ignore the EL expressions similar to comments.
- CBoth of the above.
- DNone of the above.
8_jspService() method of HttpJspPage class should not be overridden.
- ATrue
- BFalse
9Is JSP technology extensible?
- ATrue
- BFalse
10What is the correct signature of jspInit() method of HttpJspPage class?
- Avoid jspInit(HTTPRequest request, HTTPResponse response)
- Bvoid jspInit(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
- Cvoid jspInit()
- Dvoid jspInit() throws ServletException, IOException
11Which of the following method can be used to read binary data stream coming from the client?
- Arequest.getInputStream()
- Bresponse.getInputStream()
- Crequest.getInputStreamData()
- Dresponse.getInputStreamData()
12Which of the following step is taken by JSP container during Compilation phase?
- AParsing the JSP.
- BTurning the JSP into a servlet.
- CCompiling the servlet.
- DAll of the above.
13Where filters are defined?
- AFilters are defined in the deployment descriptor file web.xml.
- BFilters are defined in the jsp pages.
- CBoth of the above.
- DNone of the above.
14What's the difference between JavaBeans and taglib directives?
- ATaglibs are for generating presentation elements while JavaBeans are good for storing information and state.
- BCustom tags are used to implement actions and JavaBeans are used to present information.
- CBoth of the above.
- DNone of the above.
15What is Internationalization?
- AInternationalization means creating international content on a website.
- BInternationalization means enabling a web site to provide different versions of content translated into the visitor's language or nationality.
- CInternationalization refers to creating local content on a website.
- DNone of the above.
16If a jsp is to generate a pdf page, what attribute of page directive it should use?
- AcontentType
- BgeneratePdf
- CtypePDF
- DcontentPDF
17out is instance of which class?
- Ajavax.servlet.jsp.JspWriter
- Bjavax.servlet.jsp.PrintWriter
- Cjavax.servlet.Writer
- Djavax.servlet.jsp.Writer
18If a jsp is to generate a xml page, what attribute of page directive it should use?
- AcontentXML
- BgenerateXML
- CtypeXML
- DcontentType
19Which of the following do not supports JSP directly?
- AWeblogic Server
- BWebSphere Server
- CTomcat Server
- DApache HTTP Server
20response is instance of which class?
- AResponse
- BHttpResponse
- CHttpServletResponse
- DServletResponse
21Which is the methods of generated Servlet?
- AjspInit
- BjspService
- CjspDestroy
- DAll of the above
22What JSP stands for?
- AJava Service Programming
- BJava Server Programming
- CJava Service Pages
- DJava Server Pages
23All servlet classes are required to be mapped and configured in web.xml.
- ATrue
- BFalse
24All jsp pages are required to be mapped and configured in web.xml.
- ATrue
- BFalse
25Which of the following is a server side technology?
- Ahtml
- Bjsp
- CjavaScript
- Dcss
26Which of the following is not a valid attribute of a page directives?
- Alanguage
- Bextend
- Cexport
- Dimport
27Which of the following is not a directive?
- Ainclude
- Bpage
- Cexport
- DuseBean
28session is instance of which class?
- ASession
- BHttpSession
- CHttpServletSession
- DServletSession
29What is default value of isThreadSafe?
- ATrue
- BFalse
30This object can be used to access other implicit objects in JSP.
- Arequest
- Bpage
- Ccontext
- DpageContext
31if isThreadSafe attribute of page directive is set as true, then generated servlet implements SingleThreadModel interface.
- ATrue
- BFalse
32request is instance of which class?
- ARequest
- BHttpRequest
- CHttpServletRequest
- DServletRequest
33Which of the following is not a implicit object?
- Arequest
- Bresponse
- Ccookie
- Dsession
34jspDestroy method of HttpJspPage class can be overridden.
- ATrue
- BFalse
35jspInit method of HttpJspPage class can be overridden.
- ATrue
- BFalse
36What is the correct signature of jspDestroy method of HttpJspPage class?
- Avoid jspDestroyHTTPRequestrequest,HTTPResponseresponse
- Bvoid jspDestroyHTTPRequestrequest,HTTPResponseresponse throws ServletException, IOException
- Cvoid jspDestroy
- Dvoid jspDestroy throws ServletException, IOException
37What is the correct signature of _jspService method of HttpJspPage class?
- Avoid _jspServiceHTTPRequestrequest,HTTPResponseresponse
- Bvoid _jspServiceHTTPRequestrequest,HTTPResponseresponse throws ServletException, IOException
- Cvoid _jspService
- Dvoid _jspService throws ServletException, IOException
38Which of the following attributes are mandatory in <jsp:getProperty /> tag?
- Aname, property
- Btype, id
- Cname, type
- Did, property
39Which of the following attributes are mandatory in <jsp:useBean /> tag?
- Aid, type
- Bid, class
- Ctype, class
- Dtype,property
40Which of the following are the valid scopes in JSP?
- Arequest, page, session, application
- Brequest, page, session, global
- Cresponse, page, session, application
- Drequest, page, context, application
41Which of the following is true about request scope?
- AObject created with request scope are accessible only from the page in which they are created.
- BObject created with request scope are accessible only from the pages which are in same session.
- CObject created with request scope are accessible only from the pages which are processing the same request.
- DObject created with request scope are accessible only from the pages which reside in same application.
42Which of the following is true about page scope?
- AObject created with request scope are accessible only from the page in which they are created.
- BObject created with request scope are accessible only from the pages which are in same session.
- CObject created with request scope are accessible only from the pages which are processing the same request.
- DObject created with request scope are accessible only from the pages which reside in same application.
43Which of the following is true about session scope?
- AObject created with request scope are accessible only from the page in which they are created.
- BObject created with request scope are accessible only from the pages which are in same session.
- CObject created with request scope are accessible only from the pages which are processing the same request.
- DObject created with request scope are accessible only from the pages which reside in same application.
44Which of the following is true about application scope?
- AObject created with request scope are accessible only from the page in which they are created.
- BObject created with request scope are accessible only from the pages which are in same session.
- CObject created with request scope are accessible only from the pages which are processing the same request.
- DObject created with request scope are accessible only from the pages which reside in same application.
45Which of the following is true about language attribute?
- AThe language attribute indicates the programming language used in scripting the servlet.
- BThe language attribute indicates the programming language used in scripting the html page.
- CThe language attribute indicates the programming language used in scripting the JSP page.
- DNone of the above.
46Which of the following attribute is used to have uncaught run-time exceptions automatically forwarded to an error processing page?
- Aerror
- BerrorPage
- Cexception
- DexceptionPage
47Which of the following attribute is used to mark a page as error processing page?
- AisErrorPage
- BerrorPage
- Cexception
- DexceptionPage
48Which of the following attributes are used in <jsp:include /> tag?
- Aid, type
- Bpage, flush
- Ctype, class
- Dtype,page
49Which of the following is not a jsp directive?
- Ainclude
- Bpage
- Cscriptlet
- DuseBean
50Which of the following is an implicit object?
- ApageContext
- BservletContext
- ChttpContext
- DsessionContext
51isErrorPage is by default true.
- ATrue
- BFalse
52application is instance of which class?
- Ajavax.servlet.ServletContext
- Bjavax.servlet.HttpContext
- Cjavax.servlet.Context
- Djavax.servlet.Application
53config is instance of which class?
- Ajavax.servlet.ServletContext
- Bjavax.servlet.ServletConfig
- Cjavax.servlet.Context
- Djavax.servlet.Application
54pageContext is instance of which class?
- Ajavax.servlet.ServletContext
- Bjavax.servlet.ServletConfig
- Cjavax.servlet.jsp.PageContext
- Djavax.servlet.Application
55Which of the following method can be used to read a form parameter in JSP?
- Arequest.getParameter
- Bresponse.getParameter
- Crequest.getValue
- Dresponse.getValue
56Which of the following method can be used to read a multiple values with same name, for example check box selections?
- Arequest.getParameter
- Bresponse.getParameter
- Crequest.getParameterValues
- Dresponse.getParameterValues
57Which of the following method can be used to read parameters names?
- Arequest.getParameter
- Bresponse.getParameter
- Crequest.getParameterNames
- Dresponse.getParameterNames
58What is true about filters?
- AJSP Filters are used to intercept requests from a client before they access a resource at back end.
- BJSP Filters are used to manipulate responses from server before they are sent back to the client.
- CBoth of the above.
- DNone of the above.
59What are cookies?
- ACookies are text files stored on the client computer and they are kept for various information tracking purpose.
- BCookies are binary files stored on the server computer and they are kept for various information tracking purpose.
- CCookies are binary files stored on the client computer and they are kept for data storage purpose.
- DNone of the above.
60Which of the following is true about isELIgnored Attribute?
- AThe isELIgnored option gives you the ability to disable the evaluation of scriplets.
- BThe isELIgnored option gives you the ability to disable the evaluation of java code in jsp.
- CThe isELIgnored option gives you the ability to disable the evaluation of Expression Language EL expressions.
- DNone of the above.
61What is default value of isELIgnored Attribute?
- ATrue
- BFalse
62Which of the following is true about buffer Attribute?
- AThe buffer attribute specifies the size of buffer.
- BThe buffer attribute specifies buffering characteristics for the server output response object.
- CBoth of the above.
- DNone of the above.
63What happens when buffer is set to a value "none"?
- AServlet output is immediately directed to the response output object.
- BCompilation error.
64Which of the following is true about autoFlush Attribute?
- AThe autoFlush attribute can specify that buffered output should be flushed automatically when the buffer is filled.
- BThe autoFlush attribute can specify that an exception should be raised to indicate buffer overflow.
- CBoth of the above.
- DNone of the above.
65What is default value of autoFlush Attribute?
- ATrue
- BFalse
66What happens when autoFlush is set to a value "false"?
- AJSP container throws exception to indicate buffer overflow when buffer is filled.
- BJSP container flushed the buffered output when buffer is filled.
- CBoth of the above.
- DNone of the above.
67Which of the following is true about extends Attribute?
- AThe extends attribute can be used to define a subclass of generated servlet.
- BThe extends attribute is used to specify a superclass that the generated servlet must extend.
- CBoth of the above.
- DNone of the above.
68Which of the following is true about import Attribute?
- AThe import attribute serves the same function as, and behaves like, the Java import statement.
- BThe value for the import option is the name of the package you want to import.
- CBoth of the above.
- DNone of the above.
69Which of the following is true about info Attribute?
- AThe info attribute lets you provide a description of the JSP.
- BThe info attribute is used by JSP container for optimization of generated servlet code.
- CBoth of the above.
- DNone of the above.
70Which of the following is true about isThreadSafe Attribute?
- AThe isThreadSafe option marks a page as being thread-safe.
- BIf you set the isThreadSafe option to false, the JSP engine makes sure that only one thread at a time is executing your JSP.
- CBy default, all JSPs are considered thread-safe.
- DAll of the above.
71Which of the following is true about session Attribute?
- AThe session attribute indicates whether or not the JSP page uses HTTP sessions.
- BA value of true means that the JSP page has access to a builtin session object.
- CA value of false means that the JSP page cannot access the builtin session object.
- DAll of the above.
72Which of the following is true about isELIgnored Attribute?
- AThe isELIgnored option gives you the ability to disable the evaluation of Expression Language EL expressions.
- BThe default value of the isELIgnored attribute is true.
- CBoth of the above.
- DNone of the above.
73What is the default value of isELIgnored attribute?
- Atrue
- Bfalse
74What will happen if isELIgnored attribute is set as false?
- AExpression Language EL expressions will not be evaluated and will be treated as static text.
- BJSP container will ignore the EL expressions similar to comments.
- CBoth of the above.
- DNone of the above.
75Which of the following is true about isScriptingEnabled Attribute?
- AThe isScriptingEnabled attribute determines if scripting elements are allowed for use.
- BThe default value true enables scriptlets, expressions, and declarations.
- CBoth of the above.
- DNone of the above.
76What is the default value of isScriptingEnabled attribute?
- Atrue
- Bfalse
77What will happen if isScriptingEnabled attribute is set as false?
- AA translation-time error will be raised if the JSP uses any scriptlets, expressions non−EL, or declarations.
- BJSP container will ignore the any scriptlets, expressions non−EL, or declarations similar to comments.
- CBoth of the above.
- DNone of the above.
78Which of the following is true about include directive?
- AThe include directive is used to include a file during the translation phase.
- Binclude directive tells the container to merge the content of other external files with the current JSP during the translation phase.
- CBoth of the above.
- DNone of the above.
79Is it possible to include files using absolute path in a JSP page using include directive?
- Atrue
- Bfalse
80Which of the following depicts correct order of phases in JSP life cycle?
- ACompilation, Initialization, Execution, Cleanup
- BInitialization, Compilation, Cleanup, Execution
- CInitialization, Cleanup, Compilation, Execution
- DCleanup, Compilation, Initialization, Execution
81Which of the following is true about Execution phase in JSP life cycle?
- AWhenever a browser requests a JSP and the page has been loaded and initialized, the JSP engine invokes the _jspService method in the JSP.
- BThe _jspService method of a JSP is invoked once per request and is responsible for generating the response for that request.
- CThe _jspService method of a JSP generates responses to all seven of the HTTP methods ie. GET, POST, DELETE etc.
- DAll of the above.
82Which of the following is true about Cleanup phase in JSP life cycle?
- AThe destruction phase of the JSP life cycle represents when a JSP is being removed from use by a container.
- BThe jspDestroy method is the JSP equivalent of the destroy method for servlets.
- CBoth of the above.
- DNone of the above.
83Which of the following is true about <jsp:useBean> action?
- AuseBean action first searches for an existing object utilizing the id and scope variables. If an object is not found, it then tries to create the specified object.
- BuseBean is used to load java beans in jsp page.
- CBoth of the above.
- DNone of the above.
84Which of the following is true about <jsp:setProperty> action?
- AThe setProperty action sets the properties of a Bean.
- BThe Bean must have been previously defined before using setProperty action.
- CBoth of the above.
- DNone of the above.
85Which of the following is true about <jsp:getProperty> action?
- AThe getProperty action gets the properties of a bean.
- BThe getProperty action converts the property of a bean to a string, and finally inserts it into the output.
- CBoth of the above.
- DNone of the above.
86Which of the following is true about <jsp:forward> action?
- AThe forward action terminates the action of the current page.
- BThe forward action forwards the request to another resource such as a static page, another JSP page, or a Java Servlet.
- CBoth of the above.
- DNone of the above.
87Which of the following is true about response.sendRedirecturl?
- AThe sendRedirect sends HTTP temporary redirect response to the browser.
- BRequest data gets lost in case of sendRedirect.
- CBoth of the above.
- DNone of the above.
88What is Localization?
- ALocalization refers to creating local content on a website.
- BLocalization refers to adding locale related information to a website.
- CLocalization means adding resources to a web site to adapt it to a particular geographical or cultural region for example Hindi translation to a web site.
- DNone of the above
89Which of the following is true about locale?
- AThis is a particular cultural or geographical region.
- BLocale is usually referred to as a language symbol followed by a country symbol which are separated by an underscore.
- CBoth of the above.
- DNone of the above.
90What is difference between <%-- comment --%> and <!-- comment -->?
- A<%-- comment --%> is JSP comment. <!-- comment --> is an HTML comment.
- B<%-- comment --%> is ignored by JSP container.
- C<!-- comment --> is ignored by browser.
- DAll of the above.
91Can a JSP page process HTML FORM data?
- Atrue
- Bfalse
92Can you make use of a ServletOutputStream object from within a JSP page?
- Atrue
- Bfalse
93What is the use of <c:set > tag?
- AIt can save values to database.
- BIt evaluates an expression and uses the results to set a value of a JavaBean.
- CIt can be used to iterate list of elements.
- DNone of the above.
94What is the use of <c:catch> tag?
- Ato catch any Throwable that occurs in its body and optionally exposes it.
- Bto catch the runtime error and redirect to error page.
- CBoth of the above.
- DNone of the above.
95What is the use of <c:if> tag?
- AIt is used to check if jsp tag library is enabled or not.
- BIt evaluates an expression and displays its body content only if the expression evaluates to true.
- CBoth of the above.
- DNone of the above.
96Which of the following is true about <c:choose> tag?
- AThe <c:choose> works like a Java switch statement in that it lets you choose between a number of alternatives.
- BThe <c:choose> tag has <c:when> tags.
- CThe <c:choose> tag has <otherwise> as default clause.
- DAll of the above.
97Which of the following is true about <c:forEach > tag?
- AThe <c:forEach > exists as a good alternative to embedding a Java for, while, or do-while loop via a scriptlet.
- BThe <c:forEach > is used to iterate over a list of items in jsp.
- CBoth of the above.
- DNone of the above.
98Which of the following is true about <c:param> tag?
- AThe <c:param> tag allows proper URL request parameter to be specified with URL.
- BThe <c:param> tag does any necessary URL encoding required
- CBoth of the above.
- DNone of the above.
99Which of the following is true about <c:redirect> tag?
- AThe <c:redirect > tag redirects the browser to an alternate URL by providing automatically URL rewriting.
- BThe <c:redirect > tag supports context-relative URLs.
- CThe <c:redirect > tag supports <c:param> tag.
- DAll of the above.
100Which of the following is true about <c:url> tag
- AThe <c:url> tag formats a URL into a string and stores it into a variable.
- BThe <c:url> tag automatically performs URL rewriting when necessary.
- CBoth of the above.
- DNone of the above.
Informationen
- Beschreibung
- Quiz am JSP, erstellt von Chris Noctskie am 26/06/2018.
- Autor
- Chris Noctskie
- Sprache
- English
- Aufrufe
- 9
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz