Meaningless Drivel is fun!
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Is 'this' a JSP IMPLICIT OBJECT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Is Watch "Is New topic


Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
Hi All,

Had the below question in JDiscuss ...

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

Which is right?

Regards,<br />Mani<br />SCJP 1.4 (95%)<br />SCWCD 1.4 (94%)
Renu Radhika
Ranch Hand

Joined: Oct 21, 2005
Posts: 243
String hello="kkk";
<%= this.hello
try will work....this is an implicit variable for java,so it will naturally be available for generated servlet class
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 549

"this" is the equivalent of "page" but I do not think that makes it an implicit object.

There is only one good answer : page.

SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
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
I agree. Here's the link:
subject: Is 'this' a JSP IMPLICIT OBJECT
It's not a secret anymore!