• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding page implicit object

 
Vimal Sharma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%=page.getServletInfo()%>

Will this run successfully or we have to cast page object

<%=((servlet)page).getServletInfo()%>


i think the <%=page.getServletInfo()%> will run without any error.

Because Method invocation depends on the value of the reference variable not its type.

Please suggest.

Thanks in advance

Vimal
SCJP 93%
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
page is java.lang.Object type and cannot be used to directly call the servlet methods, because getServletInfo() is not a method of java.lang.Object.
 
Vimal Sharma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. Bosun
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic