Home arrow Java & J2EE arrow Page 2 - The JSP Files (part 1): Purple Pigs In A Fruitbasket

Studying The Foundations - Java

Get to grips with Java Server Pages with this introductorytutorial and find out how to use one of the more powerful server-sidelanguages around. This first part explains the history and basics of JSPdocuments, and also illustrates variables, includes and the String object.

TABLE OF CONTENTS:
  1. The JSP Files (part 1): Purple Pigs In A Fruitbasket
  2. Studying The Foundations
  3. Java In A Teacup
  4. Enter John Doe
  5. Putting Two And Two Together
  6. Basket Case
  7. Alphabet Soup For The Soul
By: Vikram Vaswani and Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 9
February 07, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
JSP is based on a multi-tier architecture, which can best be explained by comparing it to the architecture seen on non-JSP sites (read: PHP- or ASP-driven sites). In the typical Apache/PHP/mySQL architecture, you have a Web server and a database server at one level, with a scripting language like PHP taking care of the communication between the two to churn out dynamic content. While this kind of architecture is fine for sites that attract a middling amount of traffic, it begins to display its warts when traffic increases and the load on the database and Web servers goes up.

The JSP architecture, on the other hand, involves more than one level, immediately making it more scalable and maintainable.

In case you're wondering what the long words mean, scalable implies that you can easily increase, or "scale up", your systems as traffic increases, while maintainable implies that it is possible to simply modify one part of the system - changing over from one database to another, for example - without affecting other areas.

In the context of JSP, a multi-tier architecture involves the Web server for static HTML content, the application server for JavaBeans and servlets, and the database server for database connectivity. Additionally, you can combine JSP with JavaBeans and Java servlets to create complex Web applications which build upon previously-released and tested code modules, thereby simplifying code maintenance and increasing reusability.

It is important to note here that JSP code is not read line-by-line, as with PHP; it is first converted into a servlet (a bytecode version of the program) and then invoked by a servlet engine (such as Tomcat) to perform the required actions. Once the servlet is executed, the results are sent back to the client. Since the servlet engine has to compile the servlet the first time around, displaying a JSP page can take a little while the first time you access it; however, the next time around, response time will be dramatically reduced, since the servlet will have already been compiled and therefore ready for immediate use.

 
 
>>> More Java & J2EE Articles          >>> More By Vikram Vaswani and Harish Kamath, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

JAVA & J2EE ARTICLES

- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: