Deploying CFML on J2EE Servers Vince Bonfanti President New Atlanta Communications, LLC.

Slides:



Advertisements
Similar presentations
CF and JSP/Servlets Developed originally by Robi Sen For the CF UnderGround II Seminar, Apr 2001 Edited and enhanced by Charlie Arehart (Robi had an emergency.
Advertisements

Java Server Pages (JSP)
JSP1 Java Server Pages (JSP) Introducing JavaServer Pages TM (JSP TM ) JSP scripting elements.
Java Servlet & JSP © copyright 2005 SNU OOPSLA Lab.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
An introduction to Java Servlet Programming
Java Server Pages by Jon Pearce. JSP Documents JSP docs are XHTML Documents containing: –Fixed-Template Data: FTD HTML Components XML markup –JSP Components:
DT211/3 Internet Application Development
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Introduction to Servlet & JSP
Web programming for project students Dr Jim Briggs.
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.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Java Servlets and JSP.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
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.
Servlet and JSP Programming: An Introduction Spiros Papadimitriou
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Introduction Servlets and JSP Celsina Bignoli
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 9 JavaServer Pages (JSP) (Based on Møller.
JSP Standard Tag Library
Integrating CFML with ASP.NET Vince Bonfanti President New Atlanta Communications, LLC.
1 CS6320 – Deployment and Context L. Grewe 2 The Servlet Container Servlets run in a container sometimes called the Servlet engine. Servlets run in a.
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
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.
IIS 7.0 for CFML Developers Vince Bonfanti. Introduction Vince Bonfanti President and co-founder of New Atlanta Software developer by training and trade.
Fall 2007cs4201 Advanced Java Programming Umar Kalim Dept. of Communication Systems Engineering
Java Servlets & Java Server Pages Lecture July 2013.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
March 12 & 13, 2007 IIS 7.0 for CFML Developers Deploying on IIS 7.0 with Adobe ColdFusion and New.
CSC 2720 Building Web Applications JavaServer Pages (JSP) The Basics.
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Java Server Pages (JSP)
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
A seminar on j2ee by saritha. s. What is J2EE J2EE (Java 2 Platform, Enterprise Edition) is a Java platform designed for the mainframe-scale computing.
CS320 Web and Internet Programming Custom Tag Library Chengyu Sun California State University, Los Angeles.
Java Servlets and Java Server Pages Norman White Stern School of Business.
Fall 2007cs4201 Advanced Java Programming Umar Kalim Dept. of Communication Systems Engineering
Web Technologies Java Beans & JSP By Praveen Kumar G.
Java Enterprise Edition Programming Page 1 of 9Configuring Servlets Web Application Context Name  In multiple web applications, a “context name” is used.
Advanced Java Session 6 New York University School of Continuing and Professional Studies.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
Advanced Java Session 6 New York University School of Continuing and Professional Studies.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
 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,
JSP JavaServer Pages. What is JSP? Java based technology that simplifies the development of dynamic web sites JSP pages are HTML pages with embedded code.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
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.
BlueDragon Editions and Advantages Lori Pacheco New Atlanta.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
CS3220 Web and Internet Programming Introduction to Java Servlets
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.
Java Servlets By: Tejashri Udavant..
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Knowledge Byte In this section, you will learn about:
MSIS 655 Advanced Business Applications Programming
Java Servlets and JSP.
Java Chapter 7 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

Deploying CFML on J2EE Servers Vince Bonfanti President New Atlanta Communications, LLC

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 1 Introduction Vince Bonfanti President and co-founder of New Atlanta ServletExec, a Java Servlet/JSP web application server (1997) JTurbo, a Type 4 JDBC driver for Microsoft SQL Server (1998) BlueDragon, a CFML/JSP web application server (2002) Member of the Java Servlet and JSP Expert Groups Sun-sponsored Java Community Process for defining Java specs Today’s presentation is one in a series: Integrating CFML and J2EE Web Applications (CFNorth, May 2002) Intro to JSP for CFML Developers (Atlanta CFUG, July 2002) Deploying CFML on J2EE Servers Mention MDCFUG in subject or message body

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 2 Overview Motivation: Why CFML on J2EE? What are Java Servlets? What are JavaServer Pages (JSP)? What is a J2EE Web Application (webapp)? BlueDragon Architecture Developing webapps that contain CFML pages Deploying a webapp in an open directory on Tomcat Configuring datasources Deploying webapps that contain CFML pages Using the BlueDragon WAR Deployment Wizard Creating CFML compiled binaries (deploying without CFML source!) Deploying a WAR file onto BEA WebLogic

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 3 Why CFML on J2EE? Many companies are standardizing on J2EE for their web application infrastructure (Internet and intranet) In-house corporate developers may be faced with top-down corporate decision to migrate to J2EE CFML consultants and solutions providers may be faced with client demands for J2EE-compatible solutions Existing CFML applications can be migrated to J2EE ColdFusion servers can be retired without rewriting CFML to JSP Benefits of J2EE scalability, robustness, reliability, portability can be realized immediately for CFML applications CFML is a legitimate presentation-layer technology for J2EE development CFML is superior to JSP in many ways CFML can provide full integration with J2EE technologies

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 4 What are Java Servlets? Java Servlets are alternatives to CGI and NSAPI/ISAPI web server extensions Java Servlets are compiled code, but are loaded dynamically.java source file gets compiled to byte code.class file Java Servlets are the core presentation-layer technology for J2EE JavaServer Pages (JSP) are built on Java Servlet “plumbing” Velocity template engine is a Java Servlet XML/XSLT transformation engines are implemented as servlets Compiled Java Servlets (.class ) are fully portable across J2EE servers and servlet/JSP engines

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 5 A Simple Java Servlet public class DateServlet extends HttpServlet { public void service( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { response.setContentType( "text/html" ); PrintWriter out = response.getWriter(); out.print( " " ); out.print( " Today " ); out.print( " " ); out.print( " Today is " + java.util.Calendar.getInstance().getTime() + " " ); out.print( " " ); }

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 6 DateServlet Output

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 7 What are JavaServer Pages? JSP is a scripting-based technology Similar to ASP and PHP, different than CFML tag-based approach JSP taglibs allow programmers to create CFML-like custom tags JSP Standard Tag Library (JSTL) recently reached 1.0 status JSP scripting language is Java Do you have to know Java to write JSP pages? YES! Theoretically can support other scripting languages, but never will JSP is translated to a Java Servlet, compiled, executed.jsp -->.java (servlet) -->.class (servlet) JSP is “another way to write servlets” JSP (.jsp ) is portable across J2EE servers Generated servlet (.java /.class ) is NOT standard, but is proprietary to the servlet/JSP container that created it

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 8 JSP Elements Scripting Elements Standard Actions Page Directives

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 9 Example JSP Page <!-- This JSP pages produces output that is exactly equivalent to the DateServlet example above --> Today Today is

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 10 Generated Java Servlet import com.newatlanta.servletexec.JSP10HttpJspPage; import com.newatlanta.servletexec.JSP10Servlet; public final class _today_xjsp extends JSP10HttpJspPage { public void _jspService( HttpServletRequest request, HttpServletResponse response ) throws ServletException, java.io.IOException { response.setContentType( "text/html" ); JspFactory na_jsp_factory = JspFactory.getDefaultFactory(); PageContext pageContext = na_jsp_factory.getPageContext( this, request, response, "null", true, 8, true ); ServletConfig config = pageContext.getServletConfig(); ServletContext application = pageContext.getServletContext(); Object page = this; JspWriter out = pageContext.getOut(); HttpSession session = pageContext.getSession();

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 11 Generated Servlet (cont.) try { out.print( " Today Today is " ); out.print( String.valueOf( java.util.Calendar.getInstance().getTime() ) ); out.print( " " ); } catch ( Throwable t ) { pageContext.handlePageException( t ); } finally { out.flush(); na_jsp_factory.releasePageContext( pageContext ); }

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 12 JSP Tag Libraries JSP custom tags (taglibs) allow Java programmers to add CFML-like tags to JSP Like Java CFX, but more powerful Theoretically, taglibs can eliminate Java code from JSP pages JSP Standard Tag Library (JSTL) 1.0 released in June Variable creation and display (expression language) Flow control: conditional statements, loops SQL Database access XML processing XML-compliance sometimes leads to awkward syntax JSTL can’t do … … … JSTL can’t do

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 13 JSTL – SQL example <sql:query var="films" dataSource="jdbc:odbc:ows,sun.jdbc.odbc.JdbcOdbcDriver"> SELECT * FROM Films SQL Query Example

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 14 What is a J2EE Webapp? “A web application is a collection of servlets, html pages, classes, and other resources that make up a complete application on a web server. The web application can be bundled and run on multiple containers from multiple vendors.” -- Java Servlet Specification Version 2.3 A J2EE webapp is characterized by a specific directory structure and a configuration file named web.xml A J2EE webapp can be bundled and deployed as a single component within a Web ARchive (WAR) file Just a ZIP file containing the webapp with the “.war” extension

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 15 Webapp Directory Structure A J2EE webapp consists of a single directory into which all content files (HTML, GIF, JPEG, JSP, CFML) are placed This is referred to as the webapp “top-level” directory May contain arbitrary subdirectories to hold content The WEB-INF subdirectory contains files that will not be served to the client The web.xml deployment descriptor is placed within the WEB-INF subdirectory The WEB-INF/classes and WEB-INF/lib subdirectories contain Java.class and.jar files (these could contain servlets, JSP tag libraries, JDBC drivers, etc.)

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 16 Webapp Context Path When deploying a webapp, the J2EE server needs to know two things: The location of the webapp directory or WAR file The URL Context Path used to specify the webapp The URL Context Path is similar to a virtual directory All URLs that start with the Context Path are mapped to the webapp for processing: Using Context Paths allows multiple web applications to be deployed on a single J2EE server Web applications are completely independent

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 17 BlueDragon Architecture BlueDragon is CFML runtime that is implemented as a standard Java Servlet The BlueDragon runtime servlet can be built into a standard J2EE webapp web.xml is configured to direct processing for all “.cfm” pages to the BlueDragon servlet Just add CFML (“.cfm”) pages and deploy! BlueDragon compiles CFML pages into an internal representation that is cached and executed from RAM Compiled CFML pages can be stored and deployed in files called BlueDragon Archives (BDA) No need to deploy CFML source files

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 18 Demonstration The world’s simplest J2EE webapp Manually creating a WAR file The BlueDragon webapp template Developing webapps that contain CFML pages Deploying as an open directory on Tomcat Configuring datasources Deploying webapps that contain CFML pages Using the BlueDragon WAR Deployment Wizard Creating compiled BDA archives Deploying a WAR file on BEA WebLogic

MDCFUG – September 10, 2002 Deploying CFML on J2EE Servers 19 BlueDragon vs CFMX Demonstration shows four things that BlueDragon/J2EE can do today that CFMX/J2EE cannot: Deploy on Tomcat Create a WAR file that can be deployed onto any standard J2EE application server Create CFML compiled binary archives (BDA) that can be deployed instead of CFML source files Deploy WAR files to BEA WebLogic