Font size
Worksheetsquiz on jsp
Total questions: 15
Worksheet time: 8mins
What is the syntax for accessing a bean property in JSP EL?
D. .
C. ()
B. []
A. {}
What is the purpose of Custom Tags in JSP?
D. To handle HTTP requests
C. To simplify JSP development by creating custom tags
B. To create dynamic web pages
A. To confuse developers
What is the purpose of the application object in JSP?
D. Handles JSP container behavior
C. Provides access to ServletContext for the generated Servlet
A. Represents the entire JSP page
B. Manages HTTP session attributes
What is the main advantage of using JSP over Servlets?
C. Easy for web designers and no need to recompile for changes
B. Dependence on web configuration
A. Longer development time
D. Mapping to web.xml is necessary
Why use RequestDispatcher to forward a request to another resource, instead of using a sendRedirect?
Redirects are no longer supported in the current servlet API.
Redirects are not a cross-platform portable mechanism
The RequestDispatcher does not require a round trip to the client, and thus is more efficient and allows the server to maintain request state
The RequestDispatcher does not use the reflection API.
Which is not a directive?
include
page
useBean
export
<c:set> belongs to which category of JSP elements?
JSP standard action
JSP directive
JSP standard Tag Library action
Java Bean
Which of the following tags are used for forwarding the request and response to another resource?
<jsp:include>
<jsp:forward>
<% @ include%>
<% @ forward%>
Which jsp code is equivalent to the below given code:
public String getServletInfo() {
return "Happy Learning JSPs";
}
<%@ page info="Happy Learning JSPs" %>
<%@ page servlet-info="Happy Learning JSPs" %>
<%@ page information="Happy Learning JSPs" %>
<%@ page servlet-information="Happy Learning JSPs" %>
Exception implicit object is recognized by setting which of the following attribute?
errorPage=true
errorPage=false
isErrorPage=true
isErrorPage=false
Which of the following are Page directive attributes?
import
extends
pageEncoding
prefix
Predict the output: Provided uname text field with the value "Harry"
<html>
<body>
<%= "Welcome "+request.getParameter("uname") %>
</body>
</html>
Welcome Harry
Harry
500 Internal Server Error : Null Pointer Exception
JSP Translation Error: request not declared
