Java Reference
In-Depth Information
To see how this really works, let's take a look at the generated servlet's _jspService()
method, which is included in the following code snippet:
public void _jspService(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
String _value = null;
try {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType(“text/html”);
pageContext = _jspxFactory.getPageContext(this, request, response,
“errorpage.jsp”, true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// begin
out.write(“\r\n\r\n<html>\r\n <head>\r\n <title>Employee “ +
“Information</title>\r\n </head>\r\n <body>\r\n “ +
“<table width=\”100%\” cellpadding=\”0\”>\r\n <tr>\r\n” +
“ <td>\r\n “);
// end
// begin [file=”C:\\EmployeeInfo.jsp”;from=(10,10);to=(13,24)]
{
String _jspx_qStr = “”;
out.flush();
_jspx_qStr = _jspx_qStr + “?employee=” + “Bob”;
_jspx_qStr = _jspx_qStr + “&title=” + “Engineer”;
pageContext.include(“header.jsp” + _jspx_qStr);
Search WWH ::




Custom Search