Precompiling a JSP Page
In JSP the translation and the compilation happens at
the same time. After compilation the jsp behaves just like a servlet or we can
say that it becomes a servlet and after compilation whenever the request comes
to server, the servlet gets execute. Some jsp containers support the capability
of precompiling a JSP page. To precompile a jsp page, access the page with a
query string of ?jsp_precompile. This we will write in the URL.
The jsp page which we are compiling will not get
executed. It is not necessary that all containers will supports the
precompilation, if it does then the jsp page will be compiled.
The code of the program is given below:
<html>
<head>
<title>Using Literls in Jsp</title>
</head>
<BODY>
<H1>Using a Literal in Jsp</H1>
<%
out.println("Days of the weeks = " );
out.println(7);
%>
<br>
<%
out.println("Number of months = ");
out.println(12);
%>
</BODY>
</html>
|
Download this example.
|