JSP

From Oracle FAQ
Jump to: navigation, search

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.

[edit] 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.

[edit] Writing JSP pages

You can use Oracle JDeveloper to create JSP pages. Alternatively you can open a standard text file and code the required HTML and Java statements manually. Look at this example:

<HTML>
<BODY>
<% out.println("Hello World"); %> <P>
Today is: <%= new java.util.Date() %> <P>
Page generated with: <%= this.getServeleteInfo() %> <P>

[edit] 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
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #