Servlets What is a Servlet?

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
Languages for Dynamic Web Documents
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
4.1 JavaScript Introduction
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Lesson 19. JavaScript errors Since JavaScript is an interpreted language, syntax errors will usually cause the script to fail. Both browsers will provide.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
JavaScript: Functions © by Pearson Education, Inc. All Rights Reserved.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
PHP Form Introduction Getting User Information Text Input.
Where does PHP code get executed?. Where does JavaScript get executed?
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
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.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
CSS1 Dynamic HTML Objects, Collections & Events. CSS2 Introduction Dynamic HTML treats HTML elements as objects. Element’s parameters can be treated as.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
USING JAVASCRIPT TO SHOW AN ALERT Web Design Sec 6-2 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
REEM ALMOTIRI Information Technology Department Majmaah University.
DHTML.
Build in Objects In JavaScript, almost "everything" is an object.
Javascript and Dynamic Web Pages: Client Side Processing
Using JavaScript to Show an Alert
Week 4: Introduction to Javascript
JavaScript Event Handling.
Intro to JavaScript CS 1150 Spring 2017.
Introduction to Web programming
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
JavaScript Functions.
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
AJAX.
JavaScript an introduction.
DHTML Javascript Internet Technology.
A second look at JavaScript
Your 1st Programming Assignment
Java Servlet Ziad A. Al-Sharif.
DHTML Javascript Internet Technology.
Functions, Regular expressions and Events
Introduction to JavaScript
JavaScript MCS/BCS.
Teaching slides Chapter 6.
Training & Development
Javascript and JQuery SRM DSC.
E-commerce Applications Development
Events: Changed and Input
Code Topic 9 Standard JavaScript Events Laura Friedman
Web-Applications & AJAX
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Web Client Side Technologies Raneem Qaddoura
Introduction to Web programming
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Servlets What is a Servlet? Servlet can be described in many ways, depending on the context. Servlet is a technology i.e. used to create web application. Servlet is an API that provides many interfaces and classes including documentations. Servlet is an interface that must be implemented for creating any servlet. Servlet is a class that extend the capabilities of the servers and respond to the incoming request. It can respond to any type of requests. Servlet is a web component that is deployed on the server to create dynamic web page.

Servlet Architecture

FAQ for Servlets What is the web application and what is the difference between Get and Post request ? What information is received by the web server if we request for a servlet ? How to run servlet in Eclipse, MyEclipse and Netbeans IDE ? What are the ways for servlet collaboration and what is the difference between RequestDispatcher and sendRedirect() method ? What is the difference between ServletConfig and ServletContext interface? How many ways we can maintain state of an user ? Which approach is mostly used in web development ? How to count total number of visitors and total response time for a request using Filter ? How to run servlet with annotation ? How to create registration form using Servlet and Oracle database ? How can we upload and download file from the server ?

What is web application? A web application is an application accessible from the web. A web application is composed of web components like Servlet, JSP, Filter etc. and other components such as HTML. The web components typically execute in Web Server and respond to HTTP request.

Example Programe JavaScript variables can contain single values: <!DOCTYPE html> <html> <body> <p>Creating a JavaScript Variable.</p> <p id="demo"></p> <script> var person = "John Doe"; document.getElementById("demo").innerHTML = person; </script> </body> </html> OUTPUT : Creating a JavaScript Variable. John Doe

Objects are variables too. But objects can contain many values Objects are variables too. But objects can contain many values. The values are written as name : value pairs (name and value separated by a colon). <!DOCTYPE html> <html> <body> <p>Creating a JavaScript Object.</p> <p id="demo"></p> <script> var person = { firstName : "John", lastName : "Doe", age : 50, eyeColor : "blue" }; document.getElementById("demo").innerHTML = person.firstName + " " + person.lastName; </script> </body> </html> Output : Creating a JavaScript Object. John Doe 50

Event Handler An HTML event can be something the browser does, or something a user does. Here are some examples of HTML events: -> An HTML web page has finished loading -> An HTML input field was changed -> An HTML button was clicked Often, when events happen, you may want to do something.

HTML allows event handler attributes, with JavaScript code, to be added to HTML elements. With single quotes: <some-HTML-element some-event='some JavaScript'> With double quotes: <some-HTML-element some-event="some JavaScript">

In the following example, an onclick attribute (with code), is added to a button element: <!DOCTYPE html> <html> <body> <button onclick="document.getElementById('demo').innerHTML=Date()">The time is?</button> <p id="demo"></p> </body> </html> Output :

DHTML Three Important Concepts involved in DHTML JavaScript Alone JavaScript and the HTML DOM JavaScript and HTML Events JavaScript and CSS

JavaScript Alone document.write() <html> <body> <script type="text/javascript"> document.write(Date()); </script> </body> </html>

JavaScript and the HTML DOM With HTML 4, JavaScript can also be used to change the inner content and attributes of HTML elements dynamically. To change the content of an HTML element use: document.getElementById(id).innerHTML=new HTML To change the attribute of an HTML element use: document.getElementById(id).attribute=new value

JavaScript and HTML Events To execute code when a user clicks on an element, use the following event attribute: onclick=JavaScript

JavaScript and CSS To change the style of an HTML element use: document.getElementById(id).style.property=new style

Thank You,