When testing the JSP program today, I want to see what the Java code translated by the server into JSP looks like. So I searched in the glassfish directory and found the translated Java code as follows:
Package org. Apache. jsp;
Import javax. servlet .*;
Import javax. servlet. http .*;
Import javax. servlet. jsp .*;
Import java. util .*;
Public final class testjsp_jsp extends org. Apache. Jasper. runtime. httpjspbase
Implements org. Apache. Jasper. runtime. jspsourcedependent {
Private Static final jspfactory _ jspxfactory = jspfactory. getdefafactory Factory ();
Private Static java. util. Vector _ jspx_dependants;
Private org. Apache. Jasper. runtime. resourceinjector _ jspx_resourceinjector;
Public object getdependants (){
Return _ jspx_dependants;
}
Public void _ jspservice (httpservletrequest request, httpservletresponse response)
Throws java. Io. ioexception, servletexception {
Pagecontext = NULL;
Httpsession session = NULL;
Servletcontext application = NULL;
Servletconfig Config = NULL;
Jspwriter out = NULL;
Object page = this;
Jspwriter _ jspx_out = NULL;
Pagecontext _ jspx_page_context = NULL;
Try {
Response. setcontenttype ("text/html; charset = gb18030 ");
Response. setheader ("X-powered-by", "JSPs/2.1 ");
Pagecontext = _ jspxfactory. getpagecontext (this, request, response,
Null, true, 8192, true );
_ Jspx_page_context = pagecontext;
Application = pagecontext. getservletcontext ();
Config = pagecontext. getservletconfig ();
Session = pagecontext. getsession ();
Out = pagecontext. getout ();
_ Jspx_out = out;
_ Jspx_resourceinjector = (Org. Apache. Jasper. runtime. resourceinjector) application. getattribute ("com. Sun. appserv. jsp. Resource. injector ");
Out. Write ("/R/N ");
Out. Write ("/R/N ");
Out. Write ("<! Doctype HTML public/"-// W3C // dtd html 4.01 transitional // en/"/"http://www.w3.org/TR/html4/loose.dtd/">/R/N ");
Out. Write ("<HTML>/R/N ");
Out. Write ("Out. Write ("<meta http-equiv =/" Content-Type/"content =/" text/html; charset = gb18030/">/R/N ");
Out. Write ("<title> insert title here </title>/R/N ");
Out. Write ("Out. Write ("<body>/R/N ");
Calendar curtime = new gregoriancalendar ();
Int H = curtime. Get (curtime. hour_of_day );
Out. println (h );
Out. Write ("/R/N ");
Out. Write ("</body>/R/N ");
Out. Write ("} Catch (throwable t ){
If (! (T instanceof skippageexception )){
Out = _ jspx_out;
If (OUT! = NULL & out. getbuffersize ()! = 0)
Out. clearbuffer ();
If (_ jspx_page_context! = NULL) _ jspx_page_context.handlepageexception (t );
}
} Finally {
_ Jspxfactory. releasepagecontext (_ jspx_page_context );
}
}
}