File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes is this options wrong ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "is this options wrong ?" Watch "is this options wrong ?" New topic

is this options wrong ?

muthu moorthy
Ranch Hand

Joined: Dec 19, 2006
Posts: 87

Which of the following are valid implicit variables in a JSP page?


Select 2 correct options.

a. error

b. page

c. this

d. root

e. context
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
This question is very simple we have to choose 2
There is no object named as error,root and context.
The remaning two are page and this.
Hence answer is b and c.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

I don't quite like this way of deduction
Can we call "this" an implicit variable ?

[My Blog]
All roads lead to JavaRanch
Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
Infact Satou, 'this' works fine. But wherever you see, when they talk about 'implicit variables' they never mention it in that list.

The reason I can find is this, any java code supports 'this' object. It is a java language fundamental. BUT THAT DOES NOT MEAN THAT IT IS A JSP IMPLICIT VARIABLE. It is a default java object avaliable inside any java class.

So in JSP, when you put <% this. ... %>, it naturally works!


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

Joined: Sep 15, 2004
Posts: 230
Adding to what I said previously ....

The below is a better sounding phrase ....

'this' is a implicit variable if 'language' of page directive is "java".
I agree. Here's the link:
subject: is this options wrong ?
It's not a secret anymore!