Beruflich Dokumente
Kultur Dokumente
Java Server PagesTM (JSP) technology provides a simplified, fast way to create
web pages that display dynamically-generated content.
Some JSP technology-enabled engines may support other languages, but the JSP
1.0 specification only specifies a scripting language based on Java
programming language.
The JSP specification, developed through an industry-wide initiative led by Sun
Microsystems, defines the interaction between the server and the JSP technology-
based page.
Why JSP?
JSP technology-based pages are compiled into servlets, so theoretically you could
write servlets to support your web-based applications.
However, JSP technology was designed to simplify the process of creating pages
by separating web presentation from web content.
In many applications, the response is a combination of template data and
dynamically-generated data. In this situation, it is much easier to work with JSP
based pages than to do everything with Servlets.
Reference implementation for JSP
The reference implementation is called as JavaServerTM Web Development Kit
1.0. Based on the 1.0 version of the JSP specification
It includes
u a simple HTTP web server,
u a JSP technology-enabled engine
u a Java Servlet engine.
How JSP different from other products?
u JSP technology is the result of industry collaboration and is designed to be
an open, industry-standard method.
u It supports numerous servers, browsers and tools.
u JSP technology speeds development with reusable components and
tags, instead of relying heavily on scripting within the page itself.
u All JSP implementations support a Java programming language-based
scripting language, which provides inherent scalability and support for
complex operations.
Comparison of JSP and ASP
JSP and Microsoft ASP technologies have many similarities. Both are designed to
create interactive pages as part of a Web-based application
Advantages of JSP’s are over ASP
Platform and Server Independence
Extensible JSP Tags
Reusability Across Platforms
The Java Advantage
Easier Maintenance
Scalability in the Enterprise
JSP Element Basics
JSP syntax is similar to XML and is actually based on XML
The container tags of JSP are represented as follows
<somejsptag attributename=“attribute
value”>
body
</somejsptag>
The empty tags of JSP are represented as follows
<somejsptag attributename=“attribute value”/>
<%
empbean.makeConnection();
if(empbean.getEmployees()){
while(empbean.getNextEmployee()){
String eid = empban.getColumn(“empid”);
String ename = empban.getColumn(“ename”);
String job = empban.getColumn(“job”);
String sal = empban.getColumn(“sal”);
%>
<tr><td><%=empid%><td><%=emname%><td>
<td><%=job%><td><%=sal%><td></tr>
<% }}
%>