3/6/00jsp00 1 Java Server Pages Nancy McCracken Northeast Parallel Architectures Center at Syracuse University.

Slides:



Advertisements
Similar presentations
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
Advertisements

Java Server Pages Jeffrey Jongko. Introduction Java Server Pages (JSP) technology was created by Sun Microsystems and is built on top of Sun’s Java Servlet.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
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.
DT211/3 Internet Application Development
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
DT228/3 Web Development JSP: Directives and Scripting elements.
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,
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?
JSP Architecture  JSP is a simple text file consisting of HTML or XML content along with JSP elements  JSP packages define the interface for the compiled.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
Introduction Servlets and JSP Celsina Bignoli
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
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.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 9 JavaServer Pages (JSP) (Based on Møller.
Netbeans – jsp.zip Introduction to JSP Netbeans – jsp.zip.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
JSP Java Server Pages Softsmith Infotech.
Introduction to JavaServer Pages (JSP) Slides from Dr. Mark Llewellyn.
Java Server Pages Lecture July Java Server Pages Java Server Pages (JSPs) provide a way to separate the generation of dynamic content (java)
Jordan Anastasiade. All rights reserved.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
 Embeds Java code  In HTML tags  When used well  Simple way to generate dynamic web-pages  When misused (complex embedded Java)  Terribly messy.
JSP Most of the web developers deploying web applications using servlets mixes the presentation logic and business logic. Separation of business logic.
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.
Stanisław Osiński, 2002JSP – A technology for serving dynamic web content Java Server Pages™ A technology for serving dynamic web content Stanisław Osiński,
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
Writing Enterprise Applications with J2EE (Fourth lesson) Alessio Bechini June 2002 (based on material by Monica Pawlan)
JSP Fundamentals Elements of a JSP Using Beans with JSP Integrating Servlets and JSP.
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.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
CSC 2720 Building Web Applications JavaServer Pages (JSP) JSP Directives and Action Elements.
OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
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.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
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.
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.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
JSP Action Elements Lec - 37.
Java Server Pages Can web pages be created specially for each user?
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.
Java Server Pages (JSP)
Java Server Pages By: Tejashri Udavant..
COMP9321 Web Application Engineering Semester 2, 2017
Scripted Page Web App Development (Java Server Pages)
MSIS 655 Advanced Business Applications Programming
Introduction to Java Server Pages
Java Server Pages (JSP)
Java Server Pages B.Ramamurthy.
Introduction to JSP Dept. of B.Voc Software Development and System Administration St. Joseph’s College(Autonomous) Trichy-02 By Dr. J. Ronald Martin Introduction.
Scripted Page Web Application Development (Java Server Pages)
Java Chapter 7 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

3/6/00jsp Java Server Pages Nancy McCracken Northeast Parallel Architectures Center at Syracuse University 111 College Place, Syracuse, NY

3/6/00jsp Abstract Java Server Pages allow special tags and java code to be embedded in HTML files. These tags and code are processed by the web server to obtain a dynamically-produced HTML page to the browser. –another architecture in the web-based distributed application arsenal. –produce dynamic web pages on the server side (as do servlets), but separate application logic from the appearance of the page. –the tags allow previously compiled java code, in the form of JavaBeans, to be used –allows fast development and testing. –may also produce XML documents, instead of HTML.

3/6/00jsp Development of JSP Java Server Pages were developed as a response to Microsoft’s Active Server Pages (ASP). The main differences are that ASP only runs on Microsoft IIS and Personal Web Servers, and JSP has user-defined tags. Development dates: (Note that JSP is built on top of servlets) –Servlet 2.1 Jan. 99 –JSP 1.0 June 99 –Source code released to Apache to develop Tomcat server November 99 –Servlet 2.2 and JSP 1.1 (J2EE1.2) December 99 –Look for further development of tag library in 00.

3/6/00jsp JSP elements A JSP page looks like a standard HTML or XML page with additional elements processed by the JSP engine. Typically, these elements create text that is inserted into the resulting document. JSP elements –JSP directive passes information to the JSP engine, enclosed in markers. –JSP actions or tags are a set of customized XML-style tags for particular actions, e.g. jsp:useBean instantiates the JavaBean class on the server. –Expression: anything between markers is evaluated by the JSP engine as a Java expression in the server environment. –Scriptlet: a small script in Java to perform other functions –Implicit Objects: servlet abstractions

3/6/00jsp Example JSP page This page prints the day of the month and year, and either “Good Morning” or Good Afternoon”, depending on the time. Welcome Today is Day: Month: Good Morning Good Afternoon

3/6/00jsp Architecture http request http response web server jsp page JSP engine compiles to a servlet URL request JavaBean Library DB properties, call methods http page response browser

3/6/00jsp JSP Directives page directives communicate page-specific information to the JSP engine, such as buffer or thread information or specify an error page. language directives specify script language + possible extensions include directive includes an external document in the page. These are often company information files or copyright files, but can also be jsp files. taglib directive indicates a library of custom tags that the page can invoke. (see helloworld.jsp example.)

3/6/00jsp JSP Tags There are a set of core JSP1.0 tags that implement JSP- technology specific operations. Additional standard tags are planned, and the user can design their own custom tags. –jsp:useBean - declares the usage of an instance of a JavaBeans component. If it does not already exist, then the instance is created and registered in the servlet environment. Several properties can be set; notably that the state of the bean is saved for the session or just the page.. –jsp:setProperty - this tag can be used to set all the properties of a Bean from the request parameter stream with parameters of the same name, or can be used to set individual properties. –jsp:getProperty - gets the property of the Bean, converts it to a String, and puts it into the implicit object “out”. –jsp:forward - forwards the request to another jsp page or servlet. –jsp:include - include another jsp page –jsp:plugin - load into the specified plug-in of the browser

3/6/00jsp Scriptlets JSP pages can include small scripts in a page. These are code fragments that are executed at request time processing. May be combined with static elements on the page or other objects in the Java servlet environment. Anything contained with or is evaluated by the script language engine, normally the Java virtual machine on the host. Declarations: the scope is the JSP file, including the include files. Declare variables or methods. – Expressions: any language expression, casts result to a String –

3/6/00jsp More on Scriptlets Note that expressions never have semicolons. Scriplets within can have declarations, expressions, or any other kind of code fragment. – –you can use any of the JSP implicit objects or classes imported by the page directive, declared in a declaration, or named in a tag.

3/6/00jsp Processing HTML Forms by Servlets In the form tag on the HTML page, you can put the action field to be a JSP page. This is compiled to be a servlet and the request and response parameters can be explicitly used in a scriptlet on the page. request.getParameter (“username”); where username is the name of a field on the form. The request object implements javax.servlet.HttpServletRequest and has the following methods, among others: –getRequest –getParameterNames –getParameterValues –getParameter

3/6/00jsp Processing HTML Forms by JavaBeans If using a Bean to process the form data, no action tag is necessary on the form. Give form element names that correspond to properties in the bean (exactly, respecting upper and lower case). First give the useBean tag to instantiate the Bean. Then give the setProperty tag either to set all properties, if all form elements names are included in the bean’s properties, or to set individual ones. Similarly, you can retrieve data from a bean property and use it in the resulting html page: Hello !

3/6/00jsp Using with XML JSP pages can be used to generate XML pages. The JSP specification provides a way for XML tools to author and manipulate JSP pages, by converting JSP tags to their XML equivalents. –add a JSP root element to the document –convert elements and directives to their XML equivalent, e.g. instead of scriptlet markers, use and XML tags. –create CDATA elements for all other (typically non-JSP) elements on the page

3/6/00jsp Industry Support Servers: Apache, iPlanet Web, IBM WebSphere, BEA WEbLogic, Inprise Application Server, ATG DYnamo, Acme, Bluestone, Gemstone, Oracle Tools: Forte SynerJ, Oracle Jdeveloper, Inprise Jbuilder, Macromedia Drumbeat 2000, NetObjects Fusion, Symantic Visual Café,... Engines: –ServletExec for IIS, Netscape, all MacOS servers –JRun for IIS, Netscape, Apache, WebSite Pro, WebSTAR –WAICoolRunner for Netscape –Caucho Resin for Apache, IIS

3/6/00jsp Community Process Java Community has put out Java Specification Request (JSR) for next version “Dot.next” JSP and Servlets, Standard Tag Library. Drafts will be posted for review at all levels: expert, participant, public Goals include support for –application events –improved debugging and tool support –improved XML support –improved JSP authoring support –better composition of components –...

3/6/00jsp JSP Resources Sun: java.sun.com/products/jsp –links for downloads, tutorials, white paper, etc. –join community process –JSP syntax card Apache: –download apache web server: –Jakarta project for Java-based web servers, including an apache module for JSP and servlets: jakarta.apache.org