Switch to full style
What's behind JSP & Servlets
Post a reply

How does JSP differ from Servlets?!!!

Thu Jun 28, 2007 10:55 pm

How does JSP differ from Servlets?
--------------------------------------------------

Java Server Pages (JSP) is a technology that lets you mix regular, static HTML with dynamically-generated HTML. Servlets, make you generate the entire page via your program, even though most of it is always the same. JSP lets you create the two parts separately. Java Server Pages (JSP) is a Sun Microsystems specification for combining Java with HTML to provide dynamic content for Web pages. When you create dynamic content, JSPs are more convenient to write than HTTP servlets because they allow you to embed Java code directly into your HTML pages, in contrast with HTTP servlets, in which you embed HTML inside Java code. JSP is part of the Java 2 Enterprise Edition (J2EE).

JSP enables you to separate the dynamic content of a Web page from its presentation. It caters to two different types of developers: HTML developers, who are responsible for the graphical design of the page, and Java developers, who handle the development of software to create the dynamic content. Example of JSP
java code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Welcome to Our Store</TITLE></HEAD>
<BODY>
<H1>Welcome to Our Store</H1>
<SMALL>Welcome,
<!-- User name is "New User" for first-time visitors -->
<% out.println(Utils.getUserNameFromCookie(request)); %>
To access your account settings, click
<A HREF="Account-Settings.html">here.</A></SMALL>
<P>
Regular HTML for all the rest of the on-line store's Web page.
</BODY></HTML>




Post a reply
  Related Posts  to : How does JSP differ from Servlets?!!!
 References confuse me. How do they differ from pointers?     -  
 material of jsp and servlets     -  
 Login using jsp,Servlets and Database following MVC     -  
 What is the terms applets and servlets mean?     -  
 help for making web pages using servlets     -  
 Servlets how to upload Files     -  
 Displaying Images using servlets     -  
 Guest Book Application Using Servlets     -  
 Servlets/JSP Website search page example     -  
 Data Access Object in Servlets.............     -