This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Is Watch "Is New topic
Author

Is 'this' a JSP IMPLICIT OBJECT

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 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

Joined: Jun 28, 2003
Posts: 547

"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: http://aspose.com/file-tools
 
subject: Is 'this' a JSP IMPLICIT OBJECT
 
Similar Threads
about implicit JSP objects
is this options wrong ?
valid implicit variables in a JSP
implicit objects are available to the jsp page
Illegal State Exception with GZIP jsp-help!!!!!