JSP/Servlet Correspondence
Original JSP

Some Heading

<%! 
private String randomHeading() {
return("

" + Math.random() + "

");
}
%>
<%= randomHeading() %>
31
JSP
www.corewebprogramming.com
JSP/Servlet Correspondence
Possible resulting servlet code
public class xxxx implements HttpJspPage {
private String randomHeading() {
return("

" + Math.random() + "

");
}
public void _jspService(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
request.setContentType("text/html");
HttpSession session = request.getSession(true);
JspWriter out = response.getWriter();
out.println("

Some Heading

");
out.println(randomHeading());
...
}
32
JSP
www.corewebprogramming.com
16




  

Home

About Services Network Support FAQ Order Contact
 

Java Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved