JSP Implicit Objects

JSP Implicit objects are created by the web container. These implicit objects are Java objects that implement interfaces in the Servlet and JSP API. Scripting elements in a JSP page can make use of these JSP implicit objects. There are nine (9) JSP implicit objects available.

JSP Implicit Objects are as follows:

  1. request implicit object

    The JSP implicit request object is an instance of a java class that implements the javax.servlet.http.HttpServletRequest interface. It represents the request made by the client. The request implicit object is generally used to get request parameters, request attributes, header information and query string values.

  2. response implicit object

    The JSP implicit response object is an instance of a java class that implements the javax.servlet.http.HttpServletResponse interface. It represents the response to be given to the client. The response implicit object is generally used to set the response content type, add cookie and redirect the response.

  3. out implicit object

    The JSP implicit out object is an instance of the javax.servlet.jsp.JspWriter class. It represents the output content to be sent to the client. The out implicit object is used to write the output content.

  4. session implicit object

    The JSP implicit session object is an instance of a java class that implements the javax.servlet.http.HttpSession interface. It represents a client specific conversation. The session implicit object is used to store session state for a single user.

  5. application implicit object

    The JSP implicit application object is an instance of a java class that implements the javax.servlet.ServletContext interface. It gives facility for a JSP page to obtain and set information about the web application in which it is running.

  6. exception implicit object

    The JSP implicit exception object is an instance of the java.lang.Throwable class. It is available in JSP error pages only. It represents the occured exception that caused the control to pass to the JSP error page.

  7. config implicit object

    The JSP implicit config object is an instance of the java class that implements javax.servlet.ServletConfig interface. It gives facility for a JSP page to obtain the initialization parameters available.

  8. page implicit object

    The JSP implicit page object is an instance of the java.lang.Object class. It represents the current JSP page. That is, it serves as a reference to the java servlet object that implements the JSP page on which it is accessed. It is not advisable to use this page implict object often as it consumes large memory.

  9. pageContext implicit object

    The JSP implicit pageContext object is an instance of the javax.servlet.jsp.PageContext abstract class. It provides useful context information. That is it provides methods to get and set attributes in different scopes and for transfering requests to other resources. Also it contains the reference to to implicit objects.

This JSP tutorial was added on 11/05/2008.

«

»

Comments on "JSP Implicit Objects" Tutorial:

  1. Sathya says:

    Thank you sir..

    ur ans really hepls us..:))

  2. mohan says:

    thank you very much its very simple and understandable format so its very useful for every one

  3. Anonymous says:

    It’s is easy to understand and very helpful.
    Thanks a lot.

  4. sonu chaudhary says:

    thankyu sir because due to this my problem was solve in easy way,it is easy to understand and very helpfull for us…….

  5. Dhanunjay Tanakanti says:

    Very nice… to help us

  6. sundar says:

    nice sir thank u very much

  7. ashok says:

    thank u sir

  8. Kirana says:

    very ez to understand…

  9. Rahul says:

    Thankyou sir,

  10. praveen rohal says:

    hi, can you please explain the internal working of “request” object.
    i have doubt regarding “request” whether it is httpServletRequest Interface reference var
    or
    it is class reference variable that implemented “httpServletRequest interface”

    ================let take an example=======
    i wanna to take username(textfield) in first.jsp and show it in second.jsp.

    now please let me know how it will work… how the code will compiled internally …

    please let me know i have searched a loot.. but not clear…

  11. venkat says:

    can u please any provide the detailed explanation about the pageContext

    Thanx in advance

  12. tt says:

    trc tyreuyi yutut

  13. Asha says:

    Can you please provide detailed description about config implicit object

  14. PSG says:

    Thank u…

  15. tiru says:

    HELLO ..

    If u don’t mind this is very Critical to read the letters on the Brown background

    Please change the background of the page The letters on the Panel are not visible

  16. Amit Kumar says:

    You wrote
    “The JSP implicit pageContext object is an instance of the javax.servlet.jsp.PageContext abstract class.”

    Kindly let me know how can an instance be created of abstract class?

    • Arvind Kumar Gangwar says:

      No, Abstract class never be instantaneous..we can’t create Abstract class instance.But every class have default constructor, so the class which extend Abstract class will be instantaneous.

  17. madhavan says:

    Nice to read and understand

  18. lukky says:

    its interprets in easy understandable format for every one, thanque

  19. praveen says:

    thnk u sir for u clear cut defination ..

    this defination set an image in my mind

  20. praveen says:

    can u explain about page context in detail ?????

  21. Anonymous says:

    Thanks u sir …but i have a doubt …can i create my own implicit objects in jsp….if it is possible how to create my implicit objects

  22. Aswn Kumar S says:

    well, in two interviews they asked this Q.To be honest i didn’t know the answer,your blog is simple & understandable.

  23. Sharad Jain says:

    Which implicit object is not available to JSP?
    a)Page
    b)Page context
    c)Session
    d)Exception

  24. bhanu says:

    Thank you Sir
    Its very easy to learn and understandable

  25. Anonymous says:

    thanku sir….
    it is very easy to understand

  26. Anonymous says:

    thanku sir….
    it is very easy to understand

  27. Anonymous says:

    thnx sir it is easy to understand.But if there were some example of these concept so it make more easy to understand for learner..

  28. Anonymous says:

    thanks.By using these implicit objects we want one example

  29. Padma says:

    Thank you Sir.
    we want some more depth concepts in jsp.

  30. PRASHANT says:

    Thanks.
    add some more depth concepts in jsp.

  31. Ram says:

    Good Content.

  32. Surya says:

    It’s very useful to everyone(bingners/experience).Thank a lot to give clarity information…!!!!

  33. jyoti jajpuria says:

    thanks …its really helpfull.

  34. khuhbu ajmera says:

    Thank you sir…it is easy to understand

  35. Aswini says:

    thaks for ur information sir…but i have a doubt in the line
    “The JSP implicit pageContext object is an instance of the javax.servlet.jsp.PageContext abstract class”
    how can one create an instance of an abstract class..

  36. Vishnuvardhan says:

    Thanks Joe,

    You gave clear idea about all objects .It is very helpful to us.

  37. Balaji says:

    I have never been able to Understand diff. between page and pageContext, and even config to some extent.For Example request.setAttribute(‘a’,a) can be get in as
    request.getAttribute(‘a’) in Next Page (After Request Dispatcher).

    I have been asked this in Many Interview Questions also…and none of my freinds also dont understand it clearly, everyone says this or that…like that,something like that etc………

    But None of the (Heck Break the barrier) can tell it clearly, pls explain it to me Clearly…pls explain me the difference with a small Real Time Example Sir.

  38. Anu says:

    Hi could anyone let me know if dere is any method to dynamically read the context path form the url?(preferring not to use httpservlet)

  39. Anonymous says:

    Hi Joe,
    it’s fine to see such work…heartly salute to your hard work…But it would be much better if you have given us some examples also…

  40. AWADHESH ATULKAR says:

    Hi Joe,
    it’s fine to see such work…heartly salute to your hard work…But it would be much better if you have given us some examples also…

  41. Anonymous says:

    Very Helpfull

  42. Robin Bhargava says:

    Thanks a lot. For sharing this knowledge.

  43. arjun panday says:

    thank you sir..

  44. Ghufran Ahmad says:

    great effort sir..huge output in minimum time…thanks a lot

  45. ramesh says:

    thank you sir

  46. kishore says:

    nice answer

  47. K Padmanaban says:

    Hi sir,

    Your answer is very elaborative and true to the point.

    Thanks a lot

  48. Dinesh says:

    I used to refer your site for many of my doubts. Such a clear Explanation. Hats-off to you buddy

  49. manali says:

    nice explanation….

  50. jita says:

    Thanks joe for nice collection.

  51. Ahte says:

    nicely explianed…… joe

  52. Ramanujulu says:

    thank you sir
    nice explanation

  53. shiva says:

    Hi Joe
    From the above topic i understood that implicit objects are mainly useful when we are writing the business logic. But wehave servlets already to do this task then why we need implicit objects in JSP.

  54. vijay says:

    thanks….

  55. Surya says:

    Easy and understandable. Great. Thanks

  56. krish says:

    Hi,
    Can you please explaine me how we can access to our application…

    500
    /error-pages/servererror.jsp

  57. [...] scope is very similar to HttpSession scope. Beans instantiated based on session scope scope lives through the HTTP session. Similar to [...]

  58. preeti says:

    i read your most of the articles ,it very nice

  59. Anonymous says:

    Very helpful tutorials…
    Makes the concepts so easy to understand

  60. Vikrant says:

    Awesome tutorials.There is nothing better than you on java on the web, esp. in explaining things as a teacher does.

  61. Ajay says:

    Very Nice explainations….Thanks sir..it helped a lot.

  62. Raj says:

    hi joe,could u tell me ,how to create a hit counter to website,

  63. RAJA RAO says:

    Shortcut to remember JSP implicit objects are
    SCOPE A RPR
    expand yourself each letter

  64. Anonymous says:

    very nice and simple question…….so thanks

  65. Anonymous says:

    Hi Joe, I am in my corporate training and from the day one, your blog has helped me a lot.thanks a ton !!

  66. Anonymous says:

    Short and Sweet information…
    thanks Joe…

  67. pranathi says:

    ur blog is very slow in your blog java material is more less comments is very may i think u prefare comments only

  68. srividya Reddy says:

    Itz very easy to uderstand……….

    ThanQ…..

  69. karthik says:

    Hi Joe,
    very good tutorial.
    can u plz. tell the difference between those implicit objects……

  70. Anonymous says:

    very interesting format sir. . . .

  71. Maruthi Reddy says:

    very interesting format sir. . .

  72. Anonymous says:

    Thank U.. Can u plz provide the Examples for the same

  73. Anonymous says:

    thank u for ur guidance

  74. Anonymous says:

    i like ur posts Master

  75. PSG says:

    The JSP implicit pageContext object is an instance of the javax.servlet.jsp.PageContext abstract class.

    I think “instance of” should be changed with “implementation of” because you can’t have an instance of a abstract class!.

  76. chaitanya says:

    sir, it was really easy to understand.. thanks alot sir…

  77. Megha says:

    Really Helpful for interview questions !!
    Keep Posting sir, Great Job !!

  78. Anonymous says:

    thnk uuuuuuuuu

  79. ramu says:

    how many implicit objects are there in every java class?

  80. San_Krish says:

    UseFul stuff

  81. Areeg says:

    How can I call jsp page from java class without using HttpServlet?

  82. avinash says:

    ur explanation is good ..but if some example is avilable it will be better …..

  83. Lokesh Chandramohan says:

    Awesome,Excellent.You are from Virtusa.

Your Comment

↑ Go to top