• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Jsp implicit objects

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
which implicit object is NOT available to the jsp page?
<%page isErrorPage='false' session='false' isThreadSafe='false' %>
1) page
2) pageContext
3) session
4) exception
I have confusion between opinion 3 and opinion 4. Please guide.
 
author & internet detective
Posts: 42134
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought they both were. What exam/mock is this question from?

Also note that it is bad practice to reference any of those implicit objects directly. Using expression language, you reference objects in the session not the session per se.
 
Gurukant Desai
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne for your guidance.

This question is from my company's exam.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gurukant Desai wrote:which implicit object is NOT available to the jsp page?
<%page isErrorPage='false' session='false' isThreadSafe='false' %>
1) page
2) pageContext
3) session
4) exception
I have confusion between opinion 3 and opinion 4. Please guide.



Ans: 'exception'.
Reason: implicit object 'exception' is accessible only in error page(page configured for 'error page')
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I realise that this is a zombie thread recently resurrected, but just to follow up on the answer from Gurukan

When isErrorPage is false it does not create the implicit variable: exception

Why is the answer not "3" session?
The page directive also specifies session='false'

Surely by the same logic, the session object is available only in a page configured for a session?  

Here is a test page.


Compare what happens with various values of true/false for the appropriate page directives to see what is happening.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic