JSP (Java Server Pages) is a platform independent presentation layer technology that comes with SUN's J2EE platform. JSPs are normal HTML pages with Java code pieces embedded in them. JSP pages are saved to *.jsp files. A JSP compiler is used in the background to generate a Servlet from the JSP page.
Difference between ASP and JSP
Active Server Pages (ASP) is a Microsoft standard, which is easier to develop than Java Server Pages (JSP). However ASP is a proprietary technology and is less flexible than JSP. For more information, see ASP.
Writing JSP pages
<HTML> <BODY> <% out.println("Hello World"); %> <P> Today is: <%= new java.util.Date() %> <P> Page generated with: <%= this.getServeleteInfo() %> <P>
Invoking a JSP page
A JSP gets invoked when you call a *.jsp file from your Web Server like you would call a normal *.html file. Obviously your web server need to support JSP pages and must be configured properly to handle them.
The first time you call a JSP, a servlet (*.java) will be created and compiled to a .class file. The class file is then executed on the server. Output produced by the servlet is returned to the web browser. Output will typically be HTML or XML code.
|Glossary of Terms|