java - Different Between this two method in jsp page -
java - Different Between this two method in jsp page -
what difference between:
this.log("log message");
and
((httpservlet)page).log("anothermessage");
?
if @ generated servlet jsp find this
, page
both same. here page
, implicit object in jsp.
generate servlet code jsp:
public void _jspservice(httpservletrequest request, httpservletresponse response) throws java.io.ioexception, servletexception { pagecontext pagecontext = null; httpsession session = null; servletcontext application = null; servletconfig config = null; jspwriter out = null; object page = this; // page , same jspwriter _jspx_out = null; pagecontext _jspx_page_context = null; ...
the log()
method defined in genericservlet
. here tomcat(apache) specific implementation of generated servlet jsp:
javax.servlet.genericservlet extended byjavax.servlet.http.httpservlet extended byorg.apache.jasper.runtime.httpjspbase
so this.log("log message")
equivalent ((httpservlet)page).log("anothermessage")
java
Comments
Post a Comment