Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes 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.
***********************************
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic