|
JSP Tutorial
|

JSP architecture
JSPs
are built on top of SUN’s servlet technology. JSPs are
essential an HTML page with special JSP tags embedded. These
JSP tags can contain Java code. The JSP file extension is .jsp
rather than .htm or .html. The JSP engine parses the .jsp and
creates a Java servlet source file. It then compiles the
source file into a class file, this is done the first time and
this why the JSP is probably slower the first time it is
accessed. Any time after this the special compiled servlet is
executed and is therefore returns faster.
Steps
required for a JSP request:
- The
user goes to a web site made using JSP. The user goes to a
JSP page (ending with .jsp). The web browser makes the
request via the Internet.
- The
JSP request gets sent to the Web server.
- The
Web server recognises that the file required is special (.jsp),
therefore passes the JSP file to the JSP Servlet Engine.
- If
the JSP file has been called the first time, the JSP file
is parsed, otherwise go to step 7.
- The
next step is to generate a special Servlet from the JSP
file. All the HTML required is converted to println
statements.
- The
Servlet source code is compiled into a class.
- The
Servlet is instantiated, calling the init and service
methods.
- HTML
from the Servlet output is sent via the Internet.
- HTML
results are displayed on the user’s web browser.
|
|
|