Olete.in
Articles
Mock Tests
🧪 JSP MCQ Quiz Hub
JSP Fundamentals. (MCQs) Questions
Choose a topic to test your knowledge and improve your JSP skills
1. response is instance of which class?
Response
HttpResponse
HttpServletResponse
ServletResponse
2. If a jsp is to generate a xml page what attribute of page directive it should use?
contentXML
generateXML
typeXML
contentType
3. Which of the following attributes are mandatory in <jsp:setProperty /> tag?
name property
type id
name type
id property
4. Which of the following attribute is used to have uncaught run-time exceptions automatically forwarded to an error processing page?
error
errorPage
exception
exceptionPage
5. Which of the following method can be used to read a multiple values with same name for example check box selections?
request.getParameter()
response.getParameter()
request.getParameterValues()
response.getParameterValues()
6. Which of the following is true about autoFlush Attribute?A - B - C - Both of the above.D - Q 7 -
The autoFlush attribute can specify that buffered output should be flushed automatically when the buffer is filled.
The autoFlush attribute can specify that an exception should be raised to indicate buffer overflow.
Both of the above.
None of the above.
7. Which of the following is true about isThreadSafe Attribute?
The isThreadSafe option marks a page as being thread-safe.
If you set the isThreadSafe option to false the JSP engine makes sure that only one thread at a time is executing your JSP.
By default all JSPs are considered thread-safe.
All of the above.
8. Which of the following is true about <jsp:forward> action?
The forward action terminates the action of the current page.
The forward action forwards the request to another resource such as a static page another JSP page or a Java Servlet.
Both of the above.
None of the above.
9. Which of the following is true about <c:url> tag
The &lt;c:url&gt; tag formats a URL into a string and stores it into a variable.
The &lt;c:url&gt; tag automatically performs URL rewriting when necessary.
Both of the above.
None of the above.
10. Which option is true about session scope?
Objects are accessible only from the page in which they are created
Objects are accessible only from the pages which are in same session
Objects are accessible only from the pages which are processing the same request
Objects are accessible only from the pages which reside in same application
11. The difference between Servlets and JSP is the …………….
compilation
translation
syntax
Both A and B
12. Which of the following are the valid scopes in JSP?
request page session application
request page session global
response page session application
request page context application
13. JSP includes a mechanism for defining …………………………. or custom tags.
static attributes
local attributes
dynamic attributes
global attributes
14. Which describes best an EJB handle?
An EJB handle is used to handle exceptions when accessing EJB object
An EJB handle is used to store a reference to a specific EJB object
An EJB handle is part of the Home interface
An EJB handle is used for local references inside the EJB container
15. Why DB connections are not written directly in JSPs?
B. Response is slow
Not a standard J2EE architecture
Load Balancing is not possible
Both B and C
16. How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
8
9
10
7
17. Which is not a directive?
include
page
export
useBean
18. Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
The ErrorPage Attribute
The IsErrorPage Attribute
Both A &amp; B
None of the above
19. Which http method send by browser that asks the server to get the page only?
get
post
option
put
20. DBC is a ………………… interface which means that it is used to invoke SQL commands directly
low-level
middle-level
higher-level
User
21. 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?
vs.Static HTMLB. C. D.
vs.Server-Side Includes
vs.Pure Servlets
Vs.JavaScript
22. What is JDBC?
java compiler
ava API
Java interpreter
Both A and B
23. Dynamic interception of requests and responses to transform the information is done by
servlet container
servlet config
servlet context
servlet filter
24. This is a software distribution model in which applications are hosted by a vendor or service provider and made available to customers over a network typically the Internet.
Platform as a Service (PaaS)
Infrastructure as a Service (IaaS)
Software as a Service (SaaS)
None
25. response is instance of which class?
Response
HttpResponse
HttpServletResponse
ServletResponse
26. If a jsp is to generate a xml page what attribute of page directive it should use?
contentXML
generateXML
typeXML
contentType
27. Which of the following attributes are mandatory in <jsp:setProperty /> tag?
name property
type id
name type
id property
28. Which of the following attribute is used to have uncaught run-time exceptions automatically forwarded to an error processing page?
error
errorPage
exception
exceptionPage
29. Which of the following is true about autoFlush Attribute?A - B - C - Both of the above.D - Q 7 -
The autoFlush attribute can specify that buffered output should be flushed automatically when the buffer is filled.
The autoFlush attribute can specify that an exception should be raised to indicate buffer overflow.
Both of the above.
None of the above.
30. Which of the following is true about isThreadSafe Attribute?
The isThreadSafe option marks a page as being thread-safe.
If you set the isThreadSafe option to false the JSP engine makes sure that only one thread at a time is executing your JSP.
By default all JSPs are considered thread-safe.
All of the above.
31. Which of the following is true about <jsp:forward> action?
The forward action terminates the action of the current page.
The forward action forwards the request to another resource such as a static page another JSP page or a Java Servlet.
Both of the above.
None of the above.
32. Which of the following is true about <c:url> tag
The &lt;c:url&gt; tag formats a URL into a string and stores it into a variable.
The &lt;c:url&gt; tag automatically performs URL rewriting when necessary.
Both of the above.
None of the above.
33. Which option is true about session scope?
Objects are accessible only from the page in which they are created
Objects are accessible only from the pages which are in same session
Objects are accessible only from the pages which are processing the same request
Objects are accessible only from the pages which reside in same application
34. The difference between Servlets and JSP is the …………….
compilation
translation
syntax
Both A and B
35. Which of the following are the valid scopes in JSP?
request page session application
request page session global
response page session application
request page context application
36. JSP includes a mechanism for defining …………………………. or custom tags.
static attributes
local attributes
dynamic attributes
global attributes
37. Which describes best an EJB handle?
An EJB handle is used to handle exceptions when accessing EJB object
An EJB handle is used to store a reference to a specific EJB object
An EJB handle is part of the Home interface
An EJB handle is used for local references inside the EJB container
38. Why DB connections are not written directly in JSPs?
B. Response is slow
Not a standard J2EE architecture
Load Balancing is not possible
Both B and C
39. How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
8
9
10
7
40. Which is not a directive?
include
page
export
useBean
41. Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
The ErrorPage Attribute
The IsErrorPage Attribute
Both A &amp; B
None of the above
42. Which http method send by browser that asks the server to get the page only?
get
post
option
put
43. DBC is a ………………… interface which means that it is used to invoke SQL commands directly
low-level
middle-level
higher-level
User
44. 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?
vs.Static HTMLB. C. D.
vs.Server-Side Includes
vs.Pure Servlets
Vs.JavaScript
45. What is JDBC?
java compiler
ava API
Java interpreter
Both A and B
46. Dynamic interception of requests and responses to transform the information is done by
servlet container
servlet config
servlet context
servlet filter
Submit