J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.

Slides:



Advertisements
Similar presentations
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
Advertisements

JSP1 Java Server Pages (JSP) Introducing JavaServer Pages TM (JSP TM ) JSP scripting elements.
Technology Overview JAVA Servlets CS-611 S. Witherspoon.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Server-Side vs. Client-Side Scripting Languages
Servlets and a little bit of Web Services Russell Beale.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
Introduction to JavaServer Pages Vijayan Sugumaran Dept. of DIS Oakland University Parts of this presentation was provided by
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
DT228/3 Web Development JSP: Directives and Scripting elements.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Comp2513 Java Server Pages Daniel L. Silver, Ph.D.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Java Servlets. What Are Servlets? Basically, a java program that runs on the server Basically, a java program that runs on the server Creates dynamic.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Introduction Servlets and JSP Celsina Bignoli
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
AddressBook using Servlets and Intro to JSP Lec - 33.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Dynamic Web Pages (Flash, JavaScript)
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
Slides © Marty Hall, book © Sun Microsystems Press 1 Including Files & Applets in JSP Documents Core Servlets & JSP book:
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
JSP Java Server Pages Softsmith Infotech.
Java support for WWW Babak Esfandiari (sources: Qusay Mahmoud, Roger Impey, textbook)
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
SKT-SSU IT Training Center Servlet and JSP. Chapter Ten: JSP Intro and Overview.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Chapter 10 Overview of JSP Technology. Understanding the need for JSP JSP technology enables to mix regular, static HTML with dynamically generated content.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
Slides © Marty Hall, book © Sun Microsystems Press 1 JSP Scripting Elements Core Servlets & JSP book:
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
Introduction to JavaServer Pages. 2 JSP and Servlet Limitations of servlet  It’s inaccessible to non-programmers JSP is a complement to servlet  focuses.
Chapter 6 Server-side Programming: Java Servlets
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
MC365 Application Servers, Servlets, and Java Server Pages (JSP’s): Tomcat.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Java Servlets and Java Server Pages Norman White Stern School of Business.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
Java Servlets and Java Server Pages
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
JAVA SERVER PAGES -by Rubeena Memon Deepti Jain Jaya Thakar Jisha Vettuventra.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
Tonga Institute of Higher Education IT 141: Information Systems
Introduction Servlets and JSP
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
MSIS 655 Advanced Business Applications Programming
Chapter 27 WWW and HTTP.
Introduction to Servlets
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting institutions –Slides not permitted for use in commercial training courses except when taught by coreservlets.com (see Slides can be modified however instructor desires Instructor can give PDF or hardcopy to students, but should protect the PowerPoint files –This slide is suppressed in Slide Show mode

JSP, Servlet, Struts, JSF & Java Training: J2EE Books from Sun Press: © 2005 Marty Hall 2 JSP Intro and Overview

J2EE training: 3 Agenda Understanding the need for JSP Evaluating the benefits of JSP Comparing JSP to other technologies Avoiding JSP misconceptions Understanding the JSP lifecycle Installing JSP pages Looking at JSP in the real world

J2EE training: 4 The Need for JSP With servlets, it is easy to –Read form data –Read HTTP request headers –Set HTTP status codes and response headers –Use cookies and session tracking –Share data among servlets –Remember data between requests –Get fun, high-paying jobs But, it sure is a pain to –Use those println statements to generate HTML –Maintain that HTML

J2EE training: 5 The JSP Framework Idea: –Use regular HTML for most of page –Mark servlet code with special tags –Entire JSP page gets translated into a servlet (once), and servlet is what actually gets invoked (for each request) Example: Order Confirmation <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css"> Order Confirmation Thanks for ordering !

J2EE training: 6 Benefits of JSP Although JSP technically can't do anything servlets can't do, JSP makes it easier to: –Write HTML –Read and maintain the HTML JSP makes it possible to: –Use standard HTML tools such as Macromedia DreamWeaver or Adobe GoLive. –Have different members of your team do the HTML layout than do the Java programming JSP encourages you to –Separate the (Java) code that creates the content from the (HTML) code that presents it

J2EE training: 7 Advantages of JSP Over Competing Technologies Versus ASP or ColdFusion –Better language for dynamic part –Portable to multiple servers and operating systems Versus PHP –Better language for dynamic part –Better tool support Versus pure servlets –More convenient to create HTML –Can use standard tools (e.g., DreamWeaver) –Divide and conquer –JSP programmers still need to know servlet programming

J2EE training: 8 Advantages of JSP (Continued) Versus Velocity or WebMacro –Standard Versus client-side JavaScript (in browser) –Capabilities mostly do not overlap with JSP, but You control server, not client Richer language Versus server-side JavaScript (e.g., LiveWire, BroadVision) –Richer language Versus static HTML –Dynamic features –Adding dynamic features no longer "all or nothing" decision

J2EE training: 9 Setting Up Your Environment Set your CLASSPATH. Not. Compile your code. Not. Use packages to avoid name conflicts. Not. Put JSP page in special directory. Not. –install_dir\webapps\ROOT\ (HTML and JSP -- Tomcat) install_dir\servers\default\default-app (JRun) Use special URLs to invoke JSP page. Not. –Use same URLs as for HTML pages (except for file extensions) Caveats –Previous rules about CLASSPATH, install dirs, etc., still apply to regular Java classes used by a JSP page

J2EE training: 10 Example JSP Expressions <META NAME="keywords" CONTENT="JSP,expressions,JavaServer Pages"> <META NAME="description" CONTENT="A quick example of JSP expressions."> <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css">

J2EE training: 11 Example (Continued) JSP Expressions Current time: Server: Session ID: The testParam form parameter:

J2EE training: 12 Example: Result If location was –C:\jakarta-tomcat-xx\webapps\ROOT\ jsp-scripting\Expressions.jsp or –C:\JRun4\servers\default\default-ear\default-war\ jsp-scripting\Expressions.jsp URL would be –

J2EE training: 13 Most Common Misunderstanding Forgetting JSP is Server-Side Technology Very common question –I can’t do such and such with HTML. Will JSP let me do it? Why doesn’t this question make sense? –JSP runs entirely on server –It doesn’t change content the client (browser) can handle Similar questions –How do I put a normal applet in a JSP page? Answer: send an tag to the client –How do I put an image in a JSP page? Answer: send an tag to the client –How do I use JavaScript/Acrobat/Shockwave/Etc? Answer: send the appropriate HTML tags

J2EE training: nd Most Common Misunderstanding Translation/Request Time Confusion What happens at page translation time? –JSP constructs get translated into servlet code. What happens at request time? –Servlet code gets executed. No interpretation of JSP occurs at request time. The original JSP page is totally ignored at request time; only the servlet that resulted from it is used. When does page translation occur? –Typically, the first time JSP page is accessed after it is modified. This should never happen to real user (developers should test all JSP pages they install). –Page translation does not occur for each request.

J2EE training: 15 The JSP Lifecycle Page first written Request #1 Request #2 Server restarted Request #3 Request #4 Page modified Request #5 Request #6 JSP page translated into servlet YesNo YesNo Servlet compiled YesNo YesNo Servlet instantiated and loaded into server's memory YesNoYesNoYesNo init (or equivalent) called YesNoYesNoYesNo doGet (or equivalent) called Yes

J2EE training: 16 JSP/Servlets in the Real World: Airlines Delta Airlines United Airlines AirTran American Airlines British Airways KLM Air China Saudi Arabian Airlines Iceland Air

J2EE training: 17 JSP/Servlets in the Real World: Travel Sites Travelocity.com Orbitz.com HotWire.com Hotels.com

J2EE training: 18 JSP/Servlets in the Real World: Financial Services American Century Vanguard Fidelity NY Stock Exchange First USA Bank Royal Bank of Scotland Banco Popular de Puerto Rico Bank of America China Construction Bank

J2EE training: 19 JSP/Servlets in the Real World: Retail Sears.com Walmart.com SamsClub.com Macys.com llbean.com Kohls.com Ikea.com REI.com Longaberger.com

J2EE training: 20 JSP/Servlets in the Real World: Entertainment WarnerBrothers. com Billboard.com E! (eonline.com) PBS.org

J2EE training: 21 JSP/Servlets in the Real World: Military and Federal Government DHS TSA FAA CIA NSA GSA IRS Army Navy

J2EE training: 22 JSP/Servlets in the Real World: State, Local, International

J2EE training: 23 JSP/Servlets in the Real World: Sports Baltimore Orioles Major League Baseball (mlb.com) NHL.com Nascar.com The Sports Authority Dicks Sporting Goods

J2EE training: 24 JSP/Servlets in the Real World: Search/Portals Google Half.ebay.com netscape.com excite.com dice.com

J2EE training: 25 Summary JSP makes it easier to create and maintain HTML, while still providing full access to servlet code JSP pages get translated into servlets –It is the servlets that run at request time –Client does not see anything JSP-related You still need to understand servlets –Understanding how JSP really works –Servlet code called from JSP –Knowing when servlets are better than JSP –Mixing servlets and JSP Other technologies use similar approach, but aren't as portable and don't let you use Java for the "real code"

JSP, Servlet, Struts, JSF & Java Training: J2EE Books from Sun Press: © 2005 Marty Hall 26 Questions?