Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is this options wrong ?

 
muthu moorthy
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem

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


Options

Select 2 correct options.

a. error

b. page

c. this

d. root

e. context
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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é
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't quite like this way of deduction
Can we call "this" an implicit variable ?
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

BUT I CAN NEVER ACCEPT THAT IT IS A JSP IMPLICIT VARIABLE.
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic