Web Programming II JSP (Java Server Pages) ASP request processing. The Problem. The Problem. Enterprise Application Development using J2EE

Size: px
Start display at page:

Download "Web Programming II JSP (Java Server Pages) ASP request processing. The Problem. The Problem. Enterprise Application Development using J2EE"

Transcription

1 Enterprise Application Development using J2EE Shmulik London Lecture #6 Web Programming II JSP (Java Server Pages) How we approached it in the old days (ASP) <HTML><TITLE>Multiplication Table</TITLE> <H2>Multiplication Table</H2> <TABLE border="1" cellpadding="2" cellspacing="0"> <TR height="20" bgcolor="#f0f0f0"><td width="20"></td> <% FOR J=1 TO 10 %> <TD width="20"><%=j%></td> <% NEXT FOR I=1 TO 10 %> <TR height="20"><td width="20" bgcolor="#f0f0f0"><%=i%></td> <% FOR J=1 TO 10 %> <TD width="20"><%=i*j%></td> <% NEXT NEXT %> </TABLE> </HTML> Interdisciplinary Center Herzeliza Israel Note: this example is superficial we don t need the server for the data, we might as well do it in client side JavaScript The Problem ASP request processing ResultSet result = statement.executequery( "SELECT course_id, name, hours FROM courses"); response.setcontenttype("text/html"); PrintWriter writer = response.getwriter(); writer.println( <html><body><table border=\"1\">"); writer.println("<td>id</td><td>name</td> ); while(result.next()) { long id = result.getlong(1); String name = result.getstring(2); writer.println("<td>"+id+"</td> + <td> +name+ </td> ); writer.println( </table></body></html> ); Internet The ASP page is parsed and the embedded scripts are executed to generate dynamic content IIS ISAPI Filter ASP Page File-system static content and templates Courses Database The Problem Writing HTML in Java is cumbersome and inefficient (both runtime and development cycle) We would like Web Designers to do design the page and programmers to do the logic (separation of concerns) And some continued this way in JSP <HTML> <TITLE>Multiplication Table</TITLE> <H2>Multiplication Table</H2> <TABLE border="1" cellpadding="2" cellspacing="0"> <TR height="20" bgcolor="f0f0f0"><td width="20"></td> <% for (int j=1; j<=10; j++) { %> <TD width="20"><%=j%></td> <% %> <% for (int i=0; i<=10; i++) { %> <TR height="20"><td width="20" bgcolor="f0f0f0"><%=i%></td> <% for (int j=1; j<=10; j++) { %> <TD width="20"><%=i*j%></td> <% %> </TABLE> </HTML> 1

2 But you re too smart for that <HTML> <TITLE>Multiplication Table</TITLE> <H2>Multiplication Table</H2> <TABLE border="1" cellpadding="2" cellspacing="0"> <TR height="20" bgcolor="f0f0f0"><td width="20"></td> <% for (int j=1; j<=10; j++) { %> <TD width="20"><%=j%></td> <% %> Scripting elements make <% for (int i=0; i<=10; i++) { %> <TR height="20"><td width="20" bgcolor="f0f0f0"><%=i%></td> <% for (int j=1; j<=10; j++) { %> <TD width="20"><%=i*j%></td> <% %> </TABLE> </HTML> the code messy and don t allow for good separation of concerns (design / logic) JSP offer better alternatives. Avoid scripting elements! Example (Query Form) <html> <head><title>course Search</title></head> <body> <h1>course Search</h1> <form action="course-info" method="post"> <table border="0"> <td>enter course code</td> <td><input name="code" type="text" size="10"/></td> <td><input type="submit" value="submit"/></td> </table> </form> </body> </html> Scripting Elements Imagine large pages, containing both scripting elements, JavaScript / DHTML, CSS, sometimes Applets or ActiveX controls.. server side script that generate client side script!, pages delegates control to each other.. This results in a jungle that is impossible to maintain Example (JSP Template) <html> <body> <h1>course Details</h1> <b>name:</b> ${coursename <br/> <b>code:</b> ${coursecode <br/> <b>credit points:</b> ${creditpoints <br/> </body> JSP as a Template Engine Example (Servlet) protected void dopost(httpservletrequest request Request Fetch data or compute Servlet JSP Page Use the data to fill in a JSP template Return the result of merging the static html of the template with the dynamic data String code = request.getparameter( code ); String coursename = fetch data using code String creditpoints = fetch data request.setattribute( coursename, coursename); request.setattribute( coursecode, code); request.setattribute( creditpoints, creditpoints); RequestDispatcher dispatcher = request.getrequestdispatcher( "/course-info.jsp"); dispatcher.forward(request, response); 2

3 JSP request processing JSP Tags Internet Upon first request the JSP is parsed and is compiled into a Servlet. The Servlet include code to dump static HTML code segments that appeared in the original JSP page Controller Servlet JSP container JSP Page JSP compiler JSP defines a set of HTML-like tags that allow to add dynamic content to a page In addition it provide a simple way for writing your own custom tags You can find numerous of tag libraries (often open source) Template Engines Many web frameworks use the idea of a template engine JSP, Velocity, FreeMarker (Java) Django (Python) Ruby on Rails (Ruby) Grails (Groovy) Lift (Scala) Example: include Tag Includes the content of another page (static or dynamic) in the current page <html> <body> <jsp:include page="header.html /> <jsp:include page="menu.jsp /> <h1>my special page</h1> Here is the content of my special page <jsp:include page="footer.html"/> </body> </html> Beyond Placeholders Sometimes we need more than just placeholders Lists / Tables Conditional segments Common elements header, footer.. We use JSP Tags for this Again not embedded code! Example Using <jsp:include> to include a result of a Servlet Again: this example is superficial we don t need the server for the data, we might as well do it in client side JavaScript 3

4 Example Using <jsp:include> to include a result of a Servlet multiplication_table.jsp <h2>multiplication Table</h2> <form method="get" action="multiplication_table.jsp" > Rows <select name="rows"><option value="3">3</option> </select> Columns <select name="columns"> </select> <input type="submit" value="go"> </form> multiplication_table.jsp MultiplicationTableServlet <jsp:include page="/multiplication_table_servlet" flush="true"> <jsp:param name="rows" value="<%=request.getparameter("rows")%>"/> <jsp:param name="columns" value="<%=request.getparameter("columns")%>"/> </jsp:include> MultiplicationTableServlet JSTL protected void doget( HttpServletRequest request, HttpServletResponse response) throws IOException { try { int rows = Integer.parseInt( request.getparameter("rows")); int columns = Integer.parseInt( request.getparameter("columns")); PrintWriter writer = response.getwriter(); printtable(writer, rows, columns); catch (NumberFormatException e) { System.out.println("Illegal parameter value"); JSTL - JSP Standard Tag Library Collection of tags for functions that are common to many web apps flow control, formatting, IO Introduces EL expressions Note: JSTL introduce many Tags, but not all make sense, Tags that access the database or read files directly from the JSP page is a bad idea! In general all the logic of fetching the data should be done in lower layer MultiplicationTableServlet private void printtable( PrintWriter writer, int rows, int columns) { writer.println("<table border=\"1\" cellpading >"); writer.println("<tr height=\"20\" bgcolor=</td>"); for (int j=1; j<=columns; j++) { writer.println("<td width=\"20\">"+j+"</td>"); for (int i=1; i<=rows; i++) { writer.println( "<TR height=\"20\"><td width=\"20\" " + "bgcolor=\"f0f0f0\">"+i+"</td>"); if Tag page import="sokoban.web.*"%> taglib prefix="c uri="http://java.sun.com/jstl/core" %> <jsp:include page="/header.html"/> <p>welcome to our Sokoban server. <c:if test="${!(empty sessioninfo.message)"> <p><font color="#cc3300"> <c:out value="${sessioninfo.message" /> </font></p> </c:if> EL Expressions 4

5 foreach Tag page iselignored ="false" %> taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html> <body> <h1>course List</h1> <table border="1" cellpadding="3" cellspacing="0"> <th width="80" align="center">symbol</th> <th width="400" align="center">name</th> <th width="120" align="center">instructor</th> <c:foreach var="course" items="${courses"> <td align="center">${course.symbol</td> <td align="center">${course.name</td> <td align="center">${course.instructor</td> </c:foreach> </table> </body> </html> Custom Tag Example Repeated HTML code Again, this example is superficial we are better off using JavaScript here as expanding the tag in the server will result-in large html sent to the client, and redundant server load Servlet Side public void doget(httpservletrequest request ) { ResultSet results = statement.executequery( SELECT * FROM courses ); List<CourseInfo> courses = new ArrayList<CourseInfo>(); while (results.next()) { CourseInfo course = new CourseInfo(); course.setsymbol(results.getstring( symbol )); course.setname(results.getstring( name )); request.setattribute( courses, courses); request.getrequestdispatcher( /course-list.jsp ). forward(request, response); Note: there might be too many results to be sent in a single request, it is always a good idea to limit the number of results and page through them Custom JSP Tag taglib prefix="examples uri="http://www.idc.ac.il/j2ee/examples" %> <h2>recommended EJB Books</h2> <table border=0> <td><examples:rank rank="5"/></td> <td>enterprise JavaBeans / Reichard Monson-Haefel</td> <td><examples:rank rank="5"/></td> <td>mastering Enterprise JavaBeans / Ed Roman</td> <td><examples:rank rank="4"/></td> <td>ejb Design Patterns / Floyd Marinescu</td> Tag Libraries JSP allows you to add additional tags through tag-libraries You can wrap a commonly used presentation code in a new tag and provide it to the web-designer You can find numerous tag libraries (notably JSTL) or develop your own Custom JSP Tag package examples.web.tags; import java.io.*; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; public class RankTag extends TagSupport { private static final int MAX_RANK = 5; private int rank; public void setrank(int rank) { this.rank = rank; 5

6 Custom JSP Tag public int dostarttag() throws JspException { JspWriter writer = pagecontext.getout(); try { writer.println("<table border=0 width=50>"); writer.println("<tr height=20 width=50>"); for (int i=0; i<max_rank; i++) { writer.println(i<rank? <td width=10><image + src=\"res/icons/star.gif\"</td>") : <td width=10> </td>"); writer.println("</table>"); catch (IOException e) { e.printstacktrace(); return EVAL_PAGE; WAFs Such a framework is referred to as WAF (Web Application Framework) There are many Java based WAFs, on top of JSP and/or Servlets We ll describe a general design for working with JSP & Servlets. It is used in Struts2 and other WAFs Custom JSP Tag <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, <taglib> <tlibversion>1.1</tlibversion> <jspversion>1.1</jspversion> <shortname>examples</shortname> <uri>http://www.idc.ac.il/j2ee/examples</uri> <tag> <name>rank</name> <tagclass>examples.ranktag</tagclass> <attribute> <name>rank</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> </tag> </taglib> Model2 Model2* applies a design pattern known as MVC to the problem The client directs all requests to a single controller Servlet The controller process the request, acts on the model and forwards the request to another Servlet/JSP for rendering The target Servlet/JSP render the response according to attributes passed by the controller via request/session attributes Web Application Framework Real applications consists of many Webpages both dynamic & static Pages forward/redirect request to other pages, include other pages, and call components to perform logic We need a consistent framework for organizing all presentation and logic components and the interaction between them Model2 (MVC) JSP Pages (View) Servlet (Controller) Forward request after setting attributes in request or session JavaBeans / EJB / Database (Model) 6

7 Example (ex3) Using JavaBeans login.jsp game.jsp MapRenderingServlet MIDletResponseServlet Developer Works with Java & HTML JSP Page Web-Designer Works with designer tools ControllerServlet JavaBeans Component (logic) Passing parameters Mortgage Calculator Example public class ControllerServlet extends HttpServlet { public void doget(httpservletrequest request, ) { request.setattribute( price, new Float(price)); forward Controller Servlet Price: ${price Rendering JSP page Using JavaBeans JSP allows to separate presentation from logic by using JavaBeans You embed a JavaBean in your page Set its properties, typically according to request parameters values The bean calculates the value of other properties accordingly Retrieve the value of the calculated property and include it in the page MortgageCalcBean /** * A JavaBean component for calculating a mortgage * monthly payment */ public class MortgageCalcBean implements Serializable { // The requested amount of the loan private double loanamount; // The annual interest private double interest; // The requested period of the load in years. private int years; Hold the value of the properties of the bean 7

8 MortgageCalcBean public double getloanamount() { return loanamount; public void setloanamount(double loanamount) { this.loanamount = loanamount; public double getinterest() { return interest; public void setinterest(double interest) { this.interest = interest; Setter/Getter methods, define the properties of the bean mortgage_calculator.jsp <jsp:usebean id="calc" class="mortgagecalcbean"/> <jsp:setproperty name="calc" property="loanamount" param="loanamount"/> <jsp:setproperty name="calc" property="interest" <jsp:setproperty name="calc" <form method="post" action="mortgage_calc.jsp" > Amount: <input type="text" name="loanamount" value="<%=calc.getloanamount()%>"><br> Interest: <input type="text" name="interest" value="<%=calc.getinterest()%>"><br> Years: <input type="text" name="years" value="<%=calc.getyears()%>"><br> <input type="submit" value="calculate"> </form> Monthly Payment $ <jsp:getproperty name="calc" property="monthlypayment"/> MortgageCalcBean Packaging public double getmonthlypayment() { double monthlypayment = calculatemonthlypayment(); return monthlypayment; private double calculatemonthlypayment() { double monthlyinterest = interest * 0.01 / 12; int months = years * 12; double debt = Math.pow(1+monthlyInterest, months); double monthlypayment = loanamount*debt*monthlyinterest/(debt-1); monthlypayment = Math.floor(monthlyPayment*100)/100.0; return monthlypayment; Read only property to return the result A web-application consists of many elements Static HTML pages and resources (images, clips, ) JSP pages and tag-libraries Servlets, Java classes, JARs Configuration files (descriptors) mortgage_calculator.jsp Packaging <h1 align="center">simple Mortgage Calculator</h1> <p> Below is a simple calculator for calculating the monthly payment of the mortgage. Please enter the required loan amount, the interest you expect to get for the loan and the period of the loan in years; then press the 'calculate' button. </p> tabs, tables to enhance the look of the page J2EE defines a standard form for packaging web-applications The packaging unit is called a web-module It has standard folder structure and contains standard descriptor files The module is packaged as a WAR file (Web Achieve) essentially a zip of the folder It can either be packaged standalone or as part of a J2EE application together with other web modules and ejb modules 8

9 Packaging application.xml <?xml version="1.0" encoding="iso "?> <!DOCTYPE application PUBLIC '-//Sun Microsystems, <application> <display-name>examples</display-name> <module> <web> <web-uri>examples.war</web-uri> <context-root>/examples</context-root> </web> </module> </application> Example Apache Ant and other insects Servlet and supporting classes tag library definition for JSTL JBoss specific web application descriptor web application descriptor resources libraries required by JSTL web-pages JSP & static Manual packaging is tedious & error-prone Application server tools & IDEs provide varying level of support for packaging, deployment and editing descriptor files - often not enough We ll use Apache Ant, which is a generic build tool and de-facto standard building Java applications More on Ant in a separate presentation web.xml <web-app> <servlet> <servlet-name>courselistservlet</servlet-name> <servlet-class>courselistservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>courselistservlet</servlet-name> <url-pattern>/course_list</url-pattern> </servlet-mapping> <env-entry> <env-entry-name>jdbc/idcdb</env-entry-name> <env-entry-value>!org.gjt.mm.mysql.driver!jdbc:mysql://localhost: </env-entry-value> <env-entry-type>java.lang.string</env-entry-type> </env-entry> </web-app> 9

2. Follow the installation directions and install the server on ccc

2. Follow the installation directions and install the server on ccc Installing a Web Server 1. Install a sample web server, which supports Servlets/JSPs. A light weight web server is Apache Tomcat server. You can get the server from http://tomcat.apache.org/ 2. Follow

More information

Services. Custom Tag Libraries. Today. Web Development. Role-Based. Development. Code Reuse. Tag Libraries Custom Tags. Tag Lifecycle.

Services. Custom Tag Libraries. Today. Web Development. Role-Based. Development. Code Reuse. Tag Libraries Custom Tags. Tag Lifecycle. JSP, and JSP, and 1 JSP, and Custom Lecture #6 2008 2 JSP, and JSP, and interfaces viewed as user interfaces methodologies derived from software development done in roles and teams role assignments based

More information

An Introduction to J2EE by Mark Johnson

An Introduction to J2EE by Mark Johnson An Introduction to J2EE by Mark Johnson The Java 2, Enterprise Edition (J2EE) platform has been a global market-leading enterprise platform for the past several years. But like any large technology, J2EE

More information

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline Outline CS 112 Introduction to Programming Web Programming: Backend (server side) Programming with Servlet, JSP q Admin and recap q Server-side web programming overview q Servlet programming q Java servlet

More information

Java Server Pages and Java Beans

Java Server Pages and Java Beans Java Server Pages and Java Beans Java server pages (JSP) and Java beans work together to create a web application. Java server pages are html pages that also contain regular Java code, which is included

More information

Agenda. Summary of Previous Session. Application Servers G22.3033-011. Session 3 - Main Theme Page-Based Application Servers (Part II)

Agenda. Summary of Previous Session. Application Servers G22.3033-011. Session 3 - Main Theme Page-Based Application Servers (Part II) Application Servers G22.3033-011 Session 3 - Main Theme Page-Based Application Servers (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

Web Programming with Java Servlets

Web Programming with Java Servlets Web Programming with Java Servlets Leonidas Fegaras University of Texas at Arlington Web Data Management and XML L3: Web Programming with Servlets 1 Database Connectivity with JDBC The JDBC API makes it

More information

Web Container Components Servlet JSP Tag Libraries

Web Container Components Servlet JSP Tag Libraries Web Application Development, Best Practices by Jeff Zhuk, JavaSchool.com ITS, Inc. dean@javaschool.com Web Container Components Servlet JSP Tag Libraries Servlet Standard Java class to handle an HTTP request

More information

Model-View-Controller. and. Struts 2

Model-View-Controller. and. Struts 2 Model-View-Controller and Struts 2 Problem area Mixing application logic and markup is bad practise Harder to change and maintain Error prone Harder to re-use public void doget( HttpServletRequest request,

More information

JSP Java Server Pages

JSP Java Server Pages JSP - Java Server Pages JSP Java Server Pages JSP - Java Server Pages Characteristics: A way to create dynamic web pages, Server side processing, Based on Java Technology, Large library base Platform independence

More information

Web Frameworks and WebWork

Web Frameworks and WebWork Web Frameworks and WebWork Problem area Mixing application logic and markup is bad practise Harder to change and maintain Error prone Harder to re-use public void doget( HttpServletRequest request, HttpServletResponse

More information

An introduction to web programming with Java

An introduction to web programming with Java Chapter 1 An introduction to web programming with Java Objectives Knowledge Objectives (continued) The first page of a shopping cart application The second page of a shopping cart application Components

More information

Development of Web Applications

Development of Web Applications Development of Web Applications Principles and Practice Vincent Simonet, 2013-2014 Université Pierre et Marie Curie, Master Informatique, Spécialité STL 3 Server Technologies Vincent Simonet, 2013-2014

More information

Creating Java EE Applications and Servlets with IntelliJ IDEA

Creating Java EE Applications and Servlets with IntelliJ IDEA Creating Java EE Applications and Servlets with IntelliJ IDEA In this tutorial you will: 1. Create IntelliJ IDEA project for Java EE application 2. Create Servlet 3. Deploy the application to JBoss server

More information

In this chapter, we lay the foundation for all our further discussions. We start

In this chapter, we lay the foundation for all our further discussions. We start 01 Struts.qxd 7/30/02 10:23 PM Page 1 CHAPTER 1 Introducing the Jakarta Struts Project and Its Supporting Components In this chapter, we lay the foundation for all our further discussions. We start by

More information

CS412 Interactive Lab Creating a Simple Web Form

CS412 Interactive Lab Creating a Simple Web Form CS412 Interactive Lab Creating a Simple Web Form Introduction In this laboratory, we will create a simple web form using HTML. You have seen several examples of HTML pages and forms as you have worked

More information

WIRIS quizzes web services Getting started with PHP and Java

WIRIS quizzes web services Getting started with PHP and Java WIRIS quizzes web services Getting started with PHP and Java Document Release: 1.3 2011 march, Maths for More www.wiris.com Summary This document provides client examples for PHP and Java. Contents WIRIS

More information

CrownPeak Java Web Hosting. Version 0.20

CrownPeak Java Web Hosting. Version 0.20 CrownPeak Java Web Hosting Version 0.20 2014 CrownPeak Technology, Inc. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical,

More information

BAPI. Business Application Programming Interface. Compiled by Y R Nagesh 1

BAPI. Business Application Programming Interface. Compiled by Y R Nagesh 1 BAPI Business Application Programming Interface Compiled by Y R Nagesh 1 What is BAPI A Business Application Programming Interface is a precisely defined interface providing access process and data in

More information

2.8. Session management

2.8. Session management 2.8. Session management Juan M. Gimeno, Josep M. Ribó January, 2008 Session management. Contents Motivation Hidden fields URL rewriting Cookies Session management with the Servlet/JSP API Examples Scopes

More information

Application Security

Application Security 2009 Marty Hall Declarative Web Application Security Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/

More information

Course Name: Course in JSP Course Code: P5

Course Name: Course in JSP Course Code: P5 Course Name: Course in JSP Course Code: P5 Address: Sh No BSH 1,2,3 Almedia residency, Xetia Waddo Duler Mapusa Goa E-mail Id: ITKP@3i-infotech.com Tel: (0832) 2465556 (0832) 6454066 Course Code: P5 3i

More information

Announcements. Comments on project proposals will go out by email in next couple of days...

Announcements. Comments on project proposals will go out by email in next couple of days... Announcements Comments on project proposals will go out by email in next couple of days... 3-Tier Using TP Monitor client application TP monitor interface (API, presentation, authentication) transaction

More information

Understanding Architecture and Framework of J2EE using Web Application

Understanding Architecture and Framework of J2EE using Web Application Understanding Architecture and Framework of J2EE using Web Application Devadrita Dey Sarkar,Anavi jaiswal, Ankur Saxena Amity University,UTTAR PRADESH Sector-125, Noida, UP-201303, India Abstract: This

More information

Building Web Applications, Servlets, JSP and JDBC

Building Web Applications, Servlets, JSP and JDBC Building Web Applications, Servlets, JSP and JDBC Overview Java 2 Enterprise Edition (JEE) is a powerful platform for building web applications. The JEE platform offers all the advantages of developing

More information

Hello World RESTful web service tutorial

Hello World RESTful web service tutorial Hello World RESTful web service tutorial Balázs Simon (sbalazs@iit.bme.hu), BME IIT, 2015 1 Introduction This document describes how to create a Hello World RESTful web service in Eclipse using JAX-RS

More information

Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga

Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga Web Development with NetBeans 5.0 Quick Start in Basic Web and Struts pplications Geertjan Wielenga Web Development with NetBeans 5 This tutorial takes you through the basics of using NetBeans IDE 5.0

More information

Design Approaches of Web Application with Efficient Performance in JAVA

Design Approaches of Web Application with Efficient Performance in JAVA IJCSNS International Journal of Computer Science and Network Security, VOL.11 No.7, July 2011 141 Design Approaches of Web Application with Efficient Performance in JAVA OhSoo Kwon and HyeJa Bang Dept

More information

Real SQL Programming 1

Real SQL Programming 1 Real 1 We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional programs

More information

DTS Web Developers Guide

DTS Web Developers Guide Apelon, Inc. Suite 202, 100 Danbury Road Ridgefield, CT 06877 Phone: (203) 431-2530 Fax: (203) 431-2523 www.apelon.com Apelon Distributed Terminology System (DTS) DTS Web Developers Guide Table of Contents

More information

Web Applications. For live Java training, please see training courses at

Web Applications. For live Java training, please see training courses at 2009 Marty Hall Using and Deploying Web Applications Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/

More information

Rapid Application Development. and Application Generation Tools. Walter Knesel

Rapid Application Development. and Application Generation Tools. Walter Knesel Rapid Application Development and Application Generation Tools Walter Knesel 5/2014 Java... A place where many, many ideas have been tried and discarded. A current problem is it's success: so many libraries,

More information

Web Applications and Struts 2

Web Applications and Struts 2 Web Applications and Struts 2 Problem area Problem area Separation of application logic and markup Easier to change and maintain Easier to re use Less error prone Access to functionality to solve routine

More information

Complete Java Web Development

Complete Java Web Development Complete Java Web Development JAVA-WD Rev 11.14 4 days Description Complete Java Web Development is a crash course in developing cutting edge Web applications using the latest Java EE 6 technologies from

More information

Exam Prep. Sun Certified Web Component Developer (SCWCD) for J2EE Platform

Exam Prep. Sun Certified Web Component Developer (SCWCD) for J2EE Platform Exam Prep Sun Certified Web Component Developer (SCWCD) for J2EE Platform Core Servlets & JSP book: www.coreservlets.com More Servlets & JSP book: www.moreservlets.com Servlet and JSP Training Courses:

More information

Complete Java Web Development INT2201; 4 Days; Instructor-led

Complete Java Web Development INT2201; 4 Days; Instructor-led Complete Java Web Development INT2201; 4 Days; Instructor-led Course Description Complete Java Web Development is a crash course in developing cutting edge Web applications using the latest Java EE 6 technologies

More information

Introduction to J2EE Web Technologies

Introduction to J2EE Web Technologies Introduction to J2EE Web Technologies Kyle Brown Senior Technical Staff Member IBM WebSphere Services RTP, NC brownkyl@us.ibm.com Overview What is J2EE? What are Servlets? What are JSP's? How do you use

More information

Glassfish, JAVA EE, Servlets, JSP, EJB

Glassfish, JAVA EE, Servlets, JSP, EJB Glassfish, JAVA EE, Servlets, JSP, EJB Java platform A Java platform comprises the JVM together with supporting class libraries. Java 2 Standard Edition (J2SE) (1999) provides core libraries for data structures,

More information

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java Java EE Introduction, Content Component Architecture: Why and How Java EE: Enterprise Java The Three-Tier Model The three -tier architecture allows to maintain state information, to improve performance,

More information

HTML Forms and CONTROLS

HTML Forms and CONTROLS HTML Forms and CONTROLS Web forms also called Fill-out Forms, let a user return information to a web server for some action. The processing of incoming data is handled by a script or program written in

More information

Servlets. Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun

Servlets. Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun Servlets Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun 1 What is a Servlet? A Servlet is a Java program that extends the capabilities of servers. Inherently multi-threaded.

More information

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012 CSI 2132 Lab 8 Web Programming JSP 1 Outline Web Applications Model View Controller Architectures for Web Applications Creation of a JSP application using JEE as JDK, Apache Tomcat as Server and Netbeans

More information

7 Web Databases. Access to Web Databases: Servlets, Applets. Java Server Pages PHP, PEAR. Languages: Java, PHP, Python,...

7 Web Databases. Access to Web Databases: Servlets, Applets. Java Server Pages PHP, PEAR. Languages: Java, PHP, Python,... 7 Web Databases Access to Web Databases: Servlets, Applets Java Server Pages PHP, PEAR Languages: Java, PHP, Python,... Prof. Dr. Dietmar Seipel 837 7.1 Access to Web Databases by Servlets Java Servlets

More information

Developing XML Solutions with JavaServer Pages Technology

Developing XML Solutions with JavaServer Pages Technology Developing XML Solutions with JavaServer Pages Technology XML (extensible Markup Language) is a set of syntax rules and guidelines for defining text-based markup languages. XML languages have a number

More information

CS 55.17. Developing Web Applications with Java Technologies

CS 55.17. Developing Web Applications with Java Technologies CS 55.17 Developing Web Applications with Java Technologies Class Introduction Instructor: David B. Pearson Email: Dpearson@SantaRosa.edu Yahoo! ID: DavidPearson Website: http://www.santarosa.edu/~dpearson/

More information

Web Development in Java Part I

Web Development in Java Part I Web Development in Java Part I Vítor E. Silva Souza (vitorsouza@inf.ufes.br) http://www.inf.ufes.br/ ~ vitorsouza Department of Informatics Federal University of Espírito Santo (Ufes), Vitória, ES Brazil

More information

Developing Web Applications using JavaServer Pages and Servlets

Developing Web Applications using JavaServer Pages and Servlets Redpaper Martin Keen Rafael Coutinho Sylvi Lippmann Salvatore Sollami Sundaragopal Venkatraman Steve Baber Henry Cui Craig Fleming Developing Web Applications using JavaServer Pages and Servlets This IBM

More information

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK Programming for Digital Media EE1707 JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK 1 References and Sources 1. DOM Scripting, Web Design with JavaScript

More information

Website Planning Checklist

Website Planning Checklist Website Planning Checklist The following checklist will help clarify your needs and goals when creating a website you ll be surprised at how many decisions must be made before any production begins! Even

More information

Tutorial: Building a Web Application with Struts

Tutorial: Building a Web Application with Struts Tutorial: Building a Web Application with Struts Tutorial: Building a Web Application with Struts This tutorial describes how OTN developers built a Web application for shop owners and customers of the

More information

Simplify Your Web App Development Using the Spring MVC Framework

Simplify Your Web App Development Using the Spring MVC Framework 1 of 10 24/8/2008 23:07 http://www.devx.com Printed from http://www.devx.com/java/article/22134/1954 Simplify Your Web App Development Using the Spring MVC Framework Struts is in fairly widespread use

More information

Core Java+ J2EE+Struts+Hibernate+Spring

Core Java+ J2EE+Struts+Hibernate+Spring Core Java+ J2EE+Struts+Hibernate+Spring Java technology is a portfolio of products that are based on the power of networks and the idea that the same software should run on many different kinds of systems

More information

Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc.

Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc. Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc. J1-680, Hapner/Shannon 1 Contents The Java 2 Platform, Enterprise Edition (J2EE) J2EE Environment APM and

More information

JWIG Yet Another Framework for Maintainable and Secure Web Applications

JWIG Yet Another Framework for Maintainable and Secure Web Applications JWIG Yet Another Framework for Maintainable and Secure Web Applications Anders Møller Mathias Schwarz Aarhus University Brief history - Precursers 1999: Powerful template system Form field validation,

More information

Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat

Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat Page 1 of 14 Roadmap Client-Server Architecture Introduction Two-tier Architecture Three-tier Architecture The MVC Architecture

More information

Web Application Development Using Borland JBuilder 8 WebLogic Edition

Web Application Development Using Borland JBuilder 8 WebLogic Edition Web Application Development Using Borland JBuilder 8 WebLogic Edition Jumpstart development, deployment, and debugging servlets and JSP A Borland and BEA White Paper By Sudhansu Pati, Systems Engineer

More information

Web Pages. Static Web Pages SHTML

Web Pages. Static Web Pages SHTML 1 Web Pages Htm and Html pages are static Static Web Pages 2 Pages tagged with "shtml" reveal that "Server Side Includes" are being used on the server With SSI a page can contain tags that indicate that

More information

PA165 - Lab session - Web Presentation Layer

PA165 - Lab session - Web Presentation Layer PA165 - Lab session - Web Presentation Layer Author: Martin Kuba Goal Experiment with basic building blocks of Java server side web technology servlets, filters, context listeners,

More information

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling

More information

Web Programming: Announcements. Sara Sprenkle August 3, 2006. August 3, 2006. Assignment 6 due today Project 2 due next Wednesday Review XML

Web Programming: Announcements. Sara Sprenkle August 3, 2006. August 3, 2006. Assignment 6 due today Project 2 due next Wednesday Review XML Web Programming: Java Servlets and JSPs Sara Sprenkle Announcements Assignment 6 due today Project 2 due next Wednesday Review XML Sara Sprenkle - CISC370 2 1 Web Programming Client Network Server Web

More information

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs HTML Form Widgets Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back to the web server Forms allow web servers to generate

More information

Topics. Incorporating JSP Custom Tags Into Your Web Apps. A Quick Example of Using One. What They Are. Why Developers Should Consider Them

Topics. Incorporating JSP Custom Tags Into Your Web Apps. A Quick Example of Using One. What They Are. Why Developers Should Consider Them Incorporating JSP Custom Tags Into Your Web Apps Charles Arehart Founder/CTO, Systemanage Laurel MD Topics Why They Can Be Useful 5 Steps to Using Them Finding Custom Tag Libraries The JSP Standard Tag

More information

INTRODUCTION WHY WEB APPLICATIONS?

INTRODUCTION WHY WEB APPLICATIONS? What to Expect When You Break into Web Development Bringing your career into the 21 st Century Chuck Kincaid, Venturi Technology Partners, Kalamazoo, MI ABSTRACT Are you a SAS programmer who has wanted

More information

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form.

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form. Practice Problems: These problems are intended to clarify some of the basic concepts related to access to some of the form controls. In the process you should enter the problems in the computer and run

More information

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME System Analysis and Design S.Mohammad Taheri S.Hamed Moghimi Fall 92 1 CHOOSE A PROGRAMMING LANGUAGE FOR THE PROJECT 2 CHOOSE A PROGRAMMING LANGUAGE

More information

Java in Web 2.0. Alexis Roos Principal Field Technologist, CTO Office OEM SW Sales Sun Microsystems, Inc.

Java in Web 2.0. Alexis Roos Principal Field Technologist, CTO Office OEM SW Sales Sun Microsystems, Inc. Java in Web 2.0 Alexis Roos Principal Field Technologist, CTO Office OEM SW Sales Sun Microsystems, Inc. 1 Agenda Java overview Technologies supported by Java Platform to create Web 2.0 services Future

More information

JavaScript and Dreamweaver Examples

JavaScript and Dreamweaver Examples JavaScript and Dreamweaver Examples CSC 103 October 15, 2007 Overview The World is Flat discussion JavaScript Examples Using Dreamweaver HTML in Dreamweaver JavaScript Homework 3 (due Friday) 1 JavaScript

More information

Web Development 1 A4 Project Description Web Architecture

Web Development 1 A4 Project Description Web Architecture Web Development 1 Introduction to A4, Architecture, Core Technologies A4 Project Description 2 Web Architecture 3 Web Service Web Service Web Service Browser Javascript Database Javascript Other Stuff:

More information

Security Code Review- Identifying Web Vulnerabilities

Security Code Review- Identifying Web Vulnerabilities Security Code Review- Identifying Web Vulnerabilities Kiran Maraju, CISSP, CEH, ITIL, SCJP Email: Kiran_maraju@yahoo.com 1 1.1.1 Abstract Security Code Review- Identifying Web Vulnerabilities This paper

More information

Controlling Web Application Behavior

Controlling Web Application Behavior 2006 Marty Hall Controlling Web Application Behavior The Deployment Descriptor: web.xml JSP, Servlet, Struts, JSF, AJAX, & Java 5 Training: http://courses.coreservlets.com J2EE Books from Sun Press: http://www.coreservlets.com

More information

JAHIA CMS AND PORTAL SERVER

JAHIA CMS AND PORTAL SERVER Computer Practie JAHIA CMS AND PORTAL SERVER Web Application Developer Guide DRAFT VERSION Serge Huber Jahia Ltd 1.0 english Jahia Ltd 45, rue de la Gare 1260 Nyon Switzerland i Disclaimers, Terms and

More information

Outline. Lecture 9: Java Servlet and JSP. Servlet API. HTTP Servlet Basics

Outline. Lecture 9: Java Servlet and JSP. Servlet API. HTTP Servlet Basics Lecture 9: Java Servlet and JSP Wendy Liu CSC309F Fall 2007 Outline HTTP Servlet Basics Servlet Lifecycle Request and Response Session Management JavaServer Pages (JSP) 1 2 HTTP Servlet Basics Current

More information

Java Server Pages combined with servlets in action. Generals. Java Servlets

Java Server Pages combined with servlets in action. Generals. Java Servlets Java Server Pages combined with servlets in action We want to create a small web application (library), that illustrates the usage of JavaServer Pages combined with Java Servlets. We use the JavaServer

More information

Struts Tools Tutorial. Version: 3.3.0.M5

Struts Tools Tutorial. Version: 3.3.0.M5 Struts Tools Tutorial Version: 3.3.0.M5 1. Introduction... 1 1.1. Key Features Struts Tools... 1 1.2. Other relevant resources on the topic... 2 2. Creating a Simple Struts Application... 3 2.1. Starting

More information

<Insert Picture Here> פורום BI 21.5.2013 מה בתוכנית? בוריס דהב Embedded BI Column Level,ROW LEVEL SECURITY,VPD Application Role,security טובית לייבה הפסקה OBIEE באקסליבריס נפתלי ליברמן - לימור פלדל Actionable

More information

A Guide to Understanding Web Application Development Corey Benson, SAS Institute, Inc., Cary, NC Robert Girardin, SAS Institute, Inc.

A Guide to Understanding Web Application Development Corey Benson, SAS Institute, Inc., Cary, NC Robert Girardin, SAS Institute, Inc. Paper 024-29 A Guide to Understanding Web Application Development Corey Benson, SAS Institute, Inc., Cary, NC Robert Girardin, SAS Institute, Inc., Cary, NC ABSTRACT You have been asked by your manager

More information

HTML Tables. IT 3203 Introduction to Web Development

HTML Tables. IT 3203 Introduction to Web Development IT 3203 Introduction to Web Development Tables and Forms September 3 HTML Tables Tables are your friend: Data in rows and columns Positioning of information (But you should use style sheets for this) Slicing

More information

Web Application Architecture (based J2EE 1.4 Tutorial)

Web Application Architecture (based J2EE 1.4 Tutorial) Web Application Architecture (based J2EE 1.4 Tutorial) 1 Disclaimer & Acknowledgments Even though Sang Shin is a full-time employee of Sun Microsystems, the contents here are created as his own personal

More information

Usability. Usability

Usability. Usability Objectives Review Usability Web Application Characteristics Review Servlets Deployment Sessions, Cookies Usability Trunk Test Harder than you probably thought Your answers didn t always agree Important

More information

JAVA/J2EE DEVELOPER RESUME

JAVA/J2EE DEVELOPER RESUME 1 of 5 05/01/2015 13:22 JAVA/J2EE DEVELOPER RESUME Java Developers/Architects Resumes Please note that this is a not a Job Board - We are an I.T Staffing Company and we provide candidates on a Contract

More information

How to use JavaMail to send email

How to use JavaMail to send email Chapter 15 How to use JavaMail to send email Objectives Applied Knowledge How email works Sending client Mail client software Receiving client Mail client software SMTP Sending server Mail server software

More information

Implementing the Shop with EJB

Implementing the Shop with EJB Exercise 2 Implementing the Shop with EJB 2.1 Overview This exercise is a hands-on exercise in Enterprise JavaBeans (EJB). The exercise is as similar as possible to the other exercises (in other technologies).

More information

Portals, Portlets & Liferay Platform

Portals, Portlets & Liferay Platform Portals, Portlets & Liferay Platform Repetition: Web Applications and Model View Controller (MVC) Design Pattern Web Applications Frameworks in J2EE world Struts Spring Hibernate Data Service Java Server

More information

COMP201 Java Programming

COMP201 Java Programming COMP201 Java Programming Part III: Advanced Features Topic 14: Servlets Servlets and JavaServer Pages (JSP) 1.0: A Tutorial http://www.apl.jhu.edu/~hall/java/servlet-tutorial/servlet-tutorial-intro.html

More information

Programming on the Web(CSC309F) Tutorial: Servlets && Tomcat TA:Wael Aboelsaadat

Programming on the Web(CSC309F) Tutorial: Servlets && Tomcat TA:Wael Aboelsaadat Programming on the Web(CSC309F) Tutorial: Servlets && Tomcat TA:Wael Aboelsaadat Acknowledgments : This tutorial is based on a series of articles written by James Goodwill about Tomcat && Servlets. 1 Tomcat

More information

Esigate Module Documentation

Esigate Module Documentation PORTAL FACTORY 1.0 Esigate Module Documentation Rooted in Open Source CMS, Jahia s Digital Industrialization paradigm is about streamlining Enterprise digital projects across channels to truly control

More information

Web Application Programmer's Guide

Web Application Programmer's Guide Web Application Programmer's Guide JOnAS Team ( Florent BENOIT) - March 2009 - Copyright OW2 consortium 2008-2009 This work is licensed under the Creative Commons Attribution-ShareAlike License. To view

More information

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide NGASI SaaS Hosting Automation is a JAVA SaaS Enablement infrastructure that enables web hosting services

More information

Web Applications. Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html

Web Applications. Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html 2009 Marty Hall Using and Deploying Web Applications Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/

More information

Further web design: HTML forms

Further web design: HTML forms Further web design: HTML forms Practical workbook Aims and Learning Objectives The aim of this document is to introduce HTML forms. By the end of this course you will be able to: use existing forms on

More information

Web Development and Core Java Lab Manual V th Semester

Web Development and Core Java Lab Manual V th Semester Web Development and Core Java Lab Manual V th Semester DEPT. OF COMPUTER SCIENCE AND ENGINEERING Prepared By: Kuldeep Yadav Assistant Professor, Department of Computer Science and Engineering, RPS College

More information

Java Server Pages (JSP)

Java Server Pages (JSP) Java Server Pages (JSP) What is JSP JSP simply puts Java inside HTML pages. You can take any existing HTML page and change its extension to ".jsp" instead of ".html". Scripting elements are used to provide

More information

Intell-a-Keeper Reporting System Technical Programming Guide. Tracking your Bookings without going Nuts! http://www.acorn-is.

Intell-a-Keeper Reporting System Technical Programming Guide. Tracking your Bookings without going Nuts! http://www.acorn-is. Intell-a-Keeper Reporting System Technical Programming Guide Tracking your Bookings without going Nuts! http://www.acorn-is.com 877-ACORN-99 Step 1: Contact Marian Talbert at Acorn Internet Services at

More information

Java and Web. WebWork

Java and Web. WebWork Java and Web WebWork Client/Server server client request HTTP response Inside the Server (1) HTTP requests Functionality for communicating with clients using HTTP CSS Stat. page Dyn. page Dyn. page Our

More information

Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.

Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof. Web Frameworks web development done right Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.ssa Anna Corazza Outline 2 Web technologies evolution Web frameworks Design Principles

More information

Outline. Lecture 18: Ruby on Rails MVC. Introduction to Rails

Outline. Lecture 18: Ruby on Rails MVC. Introduction to Rails Outline Lecture 18: Ruby on Rails Wendy Liu CSC309F Fall 2007 Introduction to Rails Rails Principles Inside Rails Hello World Rails with Ajax Other Framework 1 2 MVC Introduction to Rails Agile Web Development

More information

Script Handbook for Interactive Scientific Website Building

Script Handbook for Interactive Scientific Website Building Script Handbook for Interactive Scientific Website Building Version: 173205 Released: March 25, 2014 Chung-Lin Shan Contents 1 Basic Structures 1 11 Preparation 2 12 form 4 13 switch for the further step

More information

Introduction to XHTML. 2010, Robert K. Moniot 1

Introduction to XHTML. 2010, Robert K. Moniot 1 Chapter 4 Introduction to XHTML 2010, Robert K. Moniot 1 OBJECTIVES In this chapter, you will learn: Characteristics of XHTML vs. older HTML. How to write XHTML to create web pages: Controlling document

More information

01KPS BF Progettazione di applicazioni web

01KPS BF Progettazione di applicazioni web 01KPS BF Progettazione di applicazioni web Servlets in the J2EE platform Fulvio Corno Dipartimento di Automatica e Informatica Politecnico di Torino PAW - HTTP Servlets 1 The J2EE Presentation tier Servlets

More information

Website as Tool for Compare Credit Card Offers

Website as Tool for Compare Credit Card Offers Website as Tool for Compare Credit Card Offers MIRELA-CATRINEL VOICU, IZABELA ROTARU Faculty of Economics and Business Administration West University of Timisoara ROMANIA mirela.voicu@feaa.uvt.ro, izabela.rotaru@yahoo.com,

More information