• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Implicit Objects

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Please explain this in brief:

We generally call request,responce,page,application,out etc these as Implicit Objects.

I want to know what are Implicit variables and implicit methods.

Please replay.
Thanks,
Krishna
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krishna,

implicit objects usually are implicit because there's no extra effort for the programmer to use them. For example the implicit objects you mentioned are automatically provided by the servlet container (Tomcat) if you run a web application with JSP.

But implicit variables and methods doesn't sound like a common term to me. In which context did you hear or read about it?

Marco
 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krishna,

There are total 9 implicit variables, that are available to jsp page. viz application, session, request, response, out, page, pageContext, config, exception.
Because the page author does not(and can not) declare these variables explicitly, they are called implicit variables. The objects that these variables refer to are created by the servlet container and are called implicit objects.
ex.


Even though we have not defined the variable out in this example, the code will translate, compile and execute without errors. This is because out is one of nine variables that the JSP engine implicitly makes available to the JSP page.

Hope this clears your idea about implicit objects. :thumb:
reply
    Bookmark Topic Watch Topic
  • New Topic