Open In App

GATE | GATE-IT-2004 | Question 29

Like Article
Like
Save
Share
Report

Which of the following objects can be used in expressions and scriplets in JSP (Java Server Pages) without explicitly declaring them?    

(A)

session and request only

(B)

request and response only

(C)

response and session only

(D)

session, request and response



Answer: (D)

Explanation:

JSP provides certain implicit objects which are accessed using standard variables and are automatically available for use in our JSP without writing any extra code. We can directly use them within Scriptlet without initializing and declaring them. 
Request : It encapsulates the request coming from the Client and being processed by the JSP. It is passed to the JSP by the container as a parameter of the jspService( ) method. 
Session : Session are created automatically, and a new session is available even when there is no incoming session unless we have used a session = ”false” attribute in the page directive.   
Response : It is used to reply to the client(browser) with either some data or redirect to some other page 
 
Thus, option (D) is correct. 


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads