This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Page implicit Object?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

What is the real use of the Page Implicit object? Can anyone help me with this?

Thanks in advance!
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My knowledge says,it is same as this pointer in Java.
And I hope you know the funda of "this".(i.e current instance of the class)

The page object represent your current page of jsp.



***********************************
Tip: Modesty is all virtue.
***********************************
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I know the use of this keyword in java but my question is can anyone help me with an example of using the page implicit variable??
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
FYI.
page is of type Object class declared in the servlet code generated through Tomcat(or other server)from JSP.
It looks like: Object page = this;
in the servlet code.
If you want to use it(well,it is not used frequently)
you can understand from below code:

<% this.log("abcxyz"); %>
<% ((HttpServlet)page).log("anothermessage"); %>


Both of above lines are performing same task.

Hope this helps.


***********************************
Tip: Modesty is all virtue.
***********************************
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!