• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is 'this' a JSP IMPLICIT OBJECT

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

Had the below question in JDiscuss ...



I answered only 'page'. However, the test says 'page' AND 'this'.

Which is right?
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%!
String hello="kkk";
%>
<%= this.hello
%>
try this...it will work....this is an implicit variable for java,so it will naturally be available for generated servlet class
 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"this" is the equivalent of "page" but I do not think that makes it an implicit object.

There is only one good answer : page.
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hope we will NOT get these kind of questions in the exam

I also saw in some other mock test that, if language="java" in page directive THEN 'this' is same as 'page'.

The above atleast looks a valid option to me. Bluntly we cannot say 'page' and 'this' are same.

Am I right? Can someone give a confirmed answer here. May be if Bryan answers, it should be fine
reply
    Bookmark Topic Watch Topic
  • New Topic