JSP Nihileswaran No Comment 12Feb Share Welcome to CHOOLS JSP ASSESSMENT (YOU HAVE ONLY 30 MINUTES TO COMPLETE THIS PART [20 Questions]) **** Wishing You All The Best **** Instructions : To start the quiz, please provide your name, email id and phone number. All questions are mandatory* Answering each question is required before going on to the next page of questions. Your response is subject to change at any time. After completed the quiz click the submit button. If, once the time is up, it will be automatically submitted. The report will be mailed to your email address after the quiz is finished. 1. How do you access a session attribute in a JSP page? <% request.getSession().getAttribute("attributeName"); %> <% session.getAttribute("attributeName"); %> <% attribute.getAttribute("attributeName"); %> <% pageContext.getSession().getAttribute("attributeName"); %>2. How do you retrieve a parameter passed in the URL in a JSP page? request.getParameter("paramName") page.getParameter("paramName") param.getParameter("paramName") jsp.getParameter("paramName")3. How do you declare a JSP custom tag library in a JSP page? <taglib:declare> <taglib:uri> <jsp:taglib> <%@ taglib uri="..." prefix="..." %>4. In JSP, what is the purpose of the tag? Declares a JavaBean Imports a Java class Defines a custom tag Sets a session attribute5. What is the correct syntax for expressing scriptlet comments in JSP? <!-- Comment --> /* Comment */ <%-- Comment --%> // Comment6. How do you include external CSS in a JSP page? <style src="style.css"> <link rel="stylesheet" type="text/css" href="style.css"> <css include="style.css"> <jsp:style src="style.css">7. What is the purpose of the tag in JSP? Specifies the programming language for the page Configures page-level attributes Imports a Java class Defines a custom JSP tag8. In JSP, how can you declare a reusable fragment of code? <jsp:fragment> <jsp:code> <jsp:include> <jsp:scriptlet>9. Which JSP tag is used for handling exceptions? <error> <exception> <try- catch> <jsp:catch>10. What is the correct syntax for declaring a JSP variable with session scope? <jsp:sessionVar> <session:variable> <% session.setAttribute("name", value); %> <% page session.setAttribute("name", value); %>11. Which of the following files is used to configure JSP in a web application? web.xml jsp.xml config.jsp jsp-config.xml12. Which JSP tag is used to include a file or resource at the request time? <jsp:include> <jsp:forward> <c:import> <include:file>13. How can you prevent a JSP page from being cached by the browser? <%@ page cache="false" %> <meta http-equiv="Cache-Control" content="no-cache"> <jsp:cache enable="false"> <cache-control value="no-cache">14. In JSP, what is the default scope of a variable declared using the syntax? Page scope Request scope Session scope Application scope15. Which JSP tag is used to output data to the client's web browser? <out> <c:out> <output> <write>16. What is the purpose of the tag in JSP? Forwards the request to another JSP page or servlet Redirects the request to another URL Sends an HTTP error response Includes the content of another JSP page17. Which implicit object represents the HTTP request in JSP? request response session application18. What is the purpose of the tag in JSP? Declares a Java class Includes a JavaScript code block Defines a custom JSP tag Embeds Java code in the page19. sendRedirect() forward() redirectTo() include()20. What is the correct syntax for declaring a JSP variable with page scope? <jsp:declare> <jsp:variable> <% int x = 5; %> <% page int x = 5; %>5 out of 4Time is Up! Previous Elasticsearch February 12, 2024 Next R February 12, 2024 You Might Also Like Hello world CHOOLS No Comment How to Disable Avast Antivirus CHOOLS No Comment AVG Review — Is the Absolutely free Version As effective as the Premium Version? CHOOLS No Comment Understanding the Limitations of Models of Managing CHOOLS No Comment Careers Similar To Teaching CHOOLS No Comment