Jsp. JBoss Many servers (like JBoss and Glassfish) are Tomcat servers. The file structures and format for deployment are the same. Where (in what server.

Slides:



Advertisements
Similar presentations
AppViewXS Installation Infrastructure Overview Web Server Application Server.
Advertisements

May 13th, Lucek Consulting Basic Java Servlet/JSP Web Development David Lucek Lucek Consulting
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Java Server Pages (JSP)
Servlets Enterprise Systems Programming. Servlets  Servlets: server-side Java programs that enable dynamic processing of web-based requests  Web-based.
Web Application Server Apache Tomcat Downloading and Deployment Guide.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Web Development & Design Foundations with HTML5
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
Tomcat Organization Deploying applications. Confusion Like a web server Root locations are from a defined directory location In addition… from that point.
Apache Tomcat Representation and Management of Data on the Web.
Objectives:1. Investigate the Web application deployment descriptor 2. Install and deploy Tomcat and struts 3. Design and deploy a struts application Struts.
Tomcat Configuration A Very, Very, Very Brief Overview.
The Tomcat Servlet Container. About Tomcat A “servlet container” is like a mini server, but only for serving html, jsp and servlets. Many servlet containers.
Building and Deploying a Simple Web Application. Tomcat and JSP Tomcat is an application server, commonly used to host JSP applications Applications are.
Creating a.war file W(eb) AR(chive). Creating a.war file The following article may contain actual software programs in source code form. This source code.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Julien Thibault / Phil Brewster / Kristina Doing-Harris
Java Servlets and JSP.
Servlet and Tomcat Tutorial
Themes & Layout Tutorial Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written.
JSP and Servlets Lecture notes by Theodoros Anagnostopoulos.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Glassfish, JAVA EE, Servlets, JSP, EJB. Software or ResourceVersion Required NetBeans IDE, Java bundle or 6.9 Java Development Kit (JDK) 6 MySQL.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
Java Servlets CS-422. Application Mapping Your servlet application will be mapped to a directory structure: –“myapp” maps to some directory C:/docs/apps/myapp.
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
Functionality of a web server What does the web server do? Let a user request a resource Find the resource Return something to the user The resource can.
Guidelines for Homework 6. Getting Started Homework 6 requires that you complete Homework 5. –All of HW5 must run on the GridFarm. –HW6 may run elsewhere.
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 14, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Cascading Style Sheets Tom Osman. Keep the content of a webpage separate from the formatting of the page. Structure (of content)  Headings  Sub headings.
CS-4220 Dr. Mark L. Hornick1 Servlet configuration and deployment.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
CO1552 – Web Application Development Cascading Style Sheets.
Cascading Style Sheets. What is CSS? Short for Cascading Style Sheets, a new feature being added to HTML that gives more control over how pages are displayed.
IS1825: Developing Multimedia Applications for Business Lecture 1: Introduction to CSS Rob Gleasure
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
C HAPTER 11 D EPLOYING YOUR WEB APP. WAR FILE A WAR file is simply a snapshot of your web app structure, in a nice portable, compressed form (it is really.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
1 More About HTML Tables and Images. 22 Objectives You will be able to Create tables in HTML. Include images in your HTML page. Create links to other.
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.
Cascading Style Sheets
CSS Cascading Style Sheets. Cascading Style Sheet (CSS) A cascading style sheet (CSS) is a set of rules that define styles to be applied to entire Web.
Installing and Configuring Tomcat SSE. Downloading Tomcat l Download url: 4.0/release/v4.1.24/bin/
Java Enterprise Edition Programming Page 1 of 9Configuring Servlets Web Application Context Name  In multiple web applications, a “context name” is used.
Microsoft Expression Web-Illustrated Unit F: Enhancing a Design with CSS.
Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
28 Copyright © 2009, Oracle. All rights reserved. Customizing the Oracle Business Intelligence User Interface.
 2003 Prentice Hall, Inc. All rights reserved Deploying a Web Application ( may include.war )
OV Copyright © 2008 Element K Content LLC. All rights reserved. Working with Web Pages  An Introduction to Cascading Style Sheets  Format a Web.
JavaScript and Ajax (JavaScript Dynamic HTML (DHTML)) Week 7 Web site:
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
CSS Cascading Style Sheets. Session Checklist ► Learn why style sheets are needed and their advantages and disadvantages ► Learn the format of a style.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Java Web Programimi Servlet and JSP demo.
Developing the Tools Montreal 2004
Presentation transcript:

jsp

JBoss Many servers (like JBoss and Glassfish) are Tomcat servers. The file structures and format for deployment are the same. Where (in what server directory) files get deployed varies. These jsp examples were developed on JBoss

Webapps with only jsp Jsp are compiled and run as if they were servlets by tomcat, but you write only script code and the container does the rest. Jsp, css and html files will go at the root of the webapp and WEB-INF will contain just an empty web.xml: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "

Here is my (jsp) samples directory

Creating/Running a jsp for JBoss (or Tomcat) Create a directory named MyGreeting Within the MyGreeting directory, create a subdirectory named WEB-INF (capitalization matters, so be precise, and that's a dash, not an underscore) MyGreeting | +-- HelloWorld.jsp (*) | +-- WEB-INF | +-- web.xml (*) (*) denotes a file Create a JSP file named MyGreeting/HelloWorld.jsp Add the following text to the HelloWorld.jsp file: Hello World! Create the web.xml file in MyGreeting/WEB-INF/web.xml Add the following text to web.xml: note – this xml doc is basically empty. (from code/Chapter1/MyGreeting/WEB-INF/web.xml)

deployment Put the directory into Tomcat webapps or create the war file. To build the war: Drop to a command line and change to the MyGreeting directory Use the command-line jar utility, jarring up any jsp files as well as the WEB-INF dir into a war called MyGreeting: c:\j2ee\code\Chapter1\MyGreeting> jar cvf MyGreeting.war *.jsp WEB-INF Note that to jar additional files like html or css you could use jar cvf MyGreeting.war *.jsp *.html *.css WEB-INF Or jar cvf MyGreeting.war *.* WEB-INF Copy MyGreeting.war to the deploy folder in your JBoss installation (or to webapps in tomcat): c:\j2ee\code\Chapter1\MyGreeting> copy MyGreeting.war c:\j2ee\jboss\deploy\ Start JBoss Open a web browser and go to

A very simple JBoss example

url for a similar JBoss example using jsp 1) Create Work Folder Create a folder called "HelloWorld" separate from your JBoss installation. For example, the full path of your work folder could be "C:\Projects\HelloWorld".

2) Create Startup Script below (or just navigate to the bin directory and click the run batch file) In the "HelloWorld" folder create a file named "JBoss.bat" with the following content: off set JAVA_HOME=\Program Files\Java\jdk1.6.0_11 set JBossHome=\Apps\JBoss\jboss GA set Path=%JAVA_HOME%\bin;%Path% cd "%JBossHome%\bin" run.bat

Write JSP File hi.jsp in the "HelloWorld“ dir This JSP simply displays a greeting along with the current date and time. JSP Test

Create Deployment Descriptor In the "HelloWorld" folder, create a sub folder called "WEB-INF", and in that folder create a file named "web.xml" as: web.xml Hello World The deployment descriptor provides information to JBoss about your web application.

Create WAR Builder & Deployer In the "HelloWorld" folder, create a file called "Deploy.bat" as: off set JAVA_HOME=\Program Files\Java\jdk1.6.0_11 set JBossHome=\Apps\JBoss\jboss GA "%JAVA_HOME%\bin\jar.exe" -cvf helloworld.war *.jsp WEB- INF copy helloworld.war "%JBossHome%\server\default\deploy" pause This script uses Java's JAR utility to zip up the appropriate contents into a WAR file.

Test Your Web Page Run the "Deploy.bat" file. In a browser, open " to see your web application run.

A jsp with parameter

The order jsp, xml… <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" " -app_2_2.dtd"> Order Confirmation <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css"> Order Confirmation Thanks for ordering !

Css for this example BODY { background-color: #FDF5E6 } A:hover { color: red } H1 { color: #440000; text-align: center; font-family: Arial Black, Arial, Helvetica, sans-serif } H2 { color: #440000; font-family: Arial, Helvetica, sans-serif } H3 { color: #440000; font-family: Arial, Helvetica, sans-serif } UL { margin-top: 0; border-top-width: 0; padding-top: 0 } DT { font-weight: bold; } PRE { font-size: 105%; } CODE { font-size: 105%; }.TOC { font-size: 90%; font-weight: bold; font-family: Arial, Helvetica, sans-serif } TH.COLORED { background-color: #FFAD00 } TR.COLORED { background-color: #FFAD00 } TH.TITLE { background-color: #EF8429; font-size: 28px; font-family: Arial, Helvetica, sans-serif; } Remember to build directory structure with web-inf containing web.xml and jsp and css at top level. Jar into a war file and deploy in JBoss default server.

A bunch of jsp from the coreservlets text Along with an empty web.xml file, the css file from above, I packaged a bunch of the simple jsp examples from coreservlets as a war file and put them in JBoss. An example shown below.