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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -