Forums Register Login

Regarding page implicit object

+Pie Number of slices to send: Send
<%=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%
1
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Thank you. Bosun
There is no "i" in denial. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 523 times.
Similar Threads
info attribute of page directive
Difference between Page and PageContext Implicit object
request.getAttribute is null!
page.getServletInfo()
more tease
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 02:01:31.