• Post Reply Bookmark Topic Watch Topic
  • New Topic

Interview Question  RSS feed

 
Kumar Navin
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! Friends,
This was the question asked in an interview:
Where are Implicit objects created in JSP ??
Can anyone help out??

Thanks.
-navin.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Navin,
An implicit object is one that is given to you without having to define it. An example, would be the session object.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you meant 'What' not where are the implicit objects.

<rant>
This is one of those stupid 'litmus test' questions asked by dull technical recruiters who wouldn't recognize a talented developer if their life depended on it.
</rant>

For the record here they are (but don't expect memorizing these to make you a better programmer):

  • reqeust
  • response
  • out
  • session
  • application
  • config
  • pageContext
  • page

  • If you want to know more about them paste the list, as is, into google and you will find plenty of articles that explain them all, in depth.
    [ January 02, 2005: Message edited by: Ben Souther ]
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Posts: 66158
    146
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    In Ben's reply he mistakenly upper-cased the first character of each implicit variable -- they all start with lower-case characters.

    And in case you did mean "where", the answer is "within the service() method of the servlet created on behalf of the JSP".
     
    Ben Souther
    Sheriff
    Posts: 13411
    Firefox Browser Redhat VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    They were capitalized because I was listing them.
    This was to be an answer to an interview question (to be spoken, not used in code).
    Nevertheless, it's better to list them as they would be used.
    Correction made.
    [ January 02, 2005: Message edited by: Ben Souther ]
     
    Graham Thorpe
    Ranch Hand
    Posts: 265
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Implicit objects are created by the underlying JSP mechanism and accessible to Java scriptlets or expressions in JSP pages according to the inherent scope setting of the particular object type
     
    Sivi pathi
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    implicit objects are created by the web container and contain information about the particular page, session and application .
     
    Jeroen Wenting
    Ranch Hand
    Posts: 5093
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    As to where they are created, that will depend on the application server implementation.
    As the JSP author/developer you should not have to worry about that at all so unless you were applying for a job building an application server or maintaining one the question would be completely pointless.
     
    Narendra Dhande
    Ranch Hand
    Posts: 951
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello

    Implicit objects are created in the _jspService(...) method of the jsp page implementaion class.
    Please refer page no. 1-196/197 of JavaServer 2.0 Specification

    Narendra Dhande
    SCJP 1.4
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!