• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is 'this' a JSP IMPLICIT OBJECT

 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • 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?
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • 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
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic