Professional Documents
Culture Documents
Instruction
Template
Java and JSP
• JSP pages are compiled into Java servlets
before being executed.
• Benefits
– More efficient lifecycle
– Integration with Java
– Easy use of JavaBeans without writing code
– Java code can be completely avoided.
– Avoids programming.
JSP Basics
• Individual JSP pages are text files stored on the
web server.
• When a page is first requested, the JSP engine
uses the page to generate a servlet.
• The compiled servlet is saved and used to handle
later requests.
• When a page is modified, the servlet is recreated.
• Precompilation of pages is also feasible.
A Simple JSP (from Java
Enterprise in a Nutshell)
<HTML>
<BODY>
Hello, sailor, it is now <%= new java.util.Date().toString() %>
</BODY>
</HTML>