EXCEPTION HANDLING IN SERVER CLIENT PROGRAMMING

Slides:



Advertisements
Similar presentations
PHP Form and File Handling
Advertisements

Ch3: Introduction to HTML5 part 2 Dr. Abdullah Almutairi ISC 340 Fall 2014.
Chapter 31 Basic Form-Processing Techniques JavaServer Pages By Xue Bai.
Forms cs105. More Interactive web-pages So far what we have seen was to present the information. (Ex: tables. Lists,….). But it is not enough. We want.
Capturing user input: Using HTML FORMs User input Up till now, our HTML documents have all been directed at outputting information to the user However,
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
Capturing user input: Using HTML FORMs CS4320 got here on 27/11/2003.
Uploading Files. Why? By giving a user the option to upload a file you are creating an interactive page You can enable users have a greater web experience.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
HTML Forms – Interactive HTML – Web 2.0. HTML – New types for input – Degrades gracefully for browsers that do not support the html 5 input types
Client-Side programming with JavaScript 3
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
JavaScript Form Validation
INTERNET APPLICATION DEVELOPMENT For More visit:
Department of Information Technology e-Michigan Web Development 0 HTML Form Creation in the Vignette Content Management Application.
Introduction to JavaScript. JavaScript Facts A scripting language - not compiled but interpreted line by line at run-time. Platform independent. It is.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
1 HTML Forms. 22 HTML forms provide a way for a user to send information back to the web server. Originally the user input was processed on the server.
JavaScript Part 1.
CC1003N Week 6 More CSS and Javascript.. Objectives: ● More CSS Examples ● Javascript – introduction ● Uses of Javascript ● Variables ● Comments ● Control.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Creating Web Page Forms. Introducing Web Forms Web forms collect information from users Web forms include different control elements including: –Input.
1 JavaScript Part 3. Functions Allow the user to decide when a particular script should be run by the browser in stead of running as long as the page.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Javascript JavaScript is what is called a client-side scripting language:  a programming language that runs inside an Internet browser (a browser is also.
HTML FORMS The TEXT Object Presented By: Ankit Gupta.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
1 HTML Forms. Objectives You will be able to: Compose HTML forms, to accept input from the user. Identify the different kinds of input tags that can appear.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
Java Script Date Object
Servlets What is a Servlet?
>> Form Data Validation in JavaScript
JavaScript.
IS1500: Introduction to Web Development
Build in Objects In JavaScript, almost "everything" is an object.
CHAPTER 10 JAVA SCRIPT.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Lecture 11. Web Standards Continued
JavaScript Event Handling.
In this session, you will learn about:
Principles of Software Development
FORMS Explained By: Sarbjit Kaur.
Getting User Input with Forms
Form Validation and AJAX
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
Basic Contact Form user sends an
Web Programming– UFCFB Lecture 17
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
Validation and Building Small Apps
Cookies BIS1523 – Lecture 23.
Simple PHP application
HTML Forms and User Input
Unit 27 - Web Server Scripting
Intro to PHP at Winthrop
Client side & Server side scripting
FORM OBJECT When creating an interactive web site for the Internet it is necessary to capture user input and process this input. Based on the result of.
CGI programming Using Apache.
JavaScript Form Validation
Form Validation (with jQuery, HTML5, and CSS)
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT
Creating Forms on a Web Page
© Hugh McCabe 2000 Web Authoring Lecture 8
JavaScript and Ajax (JavaScript Events)
Web Development & Design Foundations with HTML5 7th Edition
Presentation transcript:

EXCEPTION HANDLING IN SERVER CLIENT PROGRAMMING how to handle exceptions correctly within a client server application. My client sends an information to the server(thread) which receives it within its run method. Exception on the client side. // Server run() { try { …… } catch(Exception e) { clientoutputstream.write(…); // transmitting the error }

Someone calls a web service on a server, the relevant data is being retrieved in batches and the message is being streamed to the client. In the middle of the message some kind of exception is encountered Current implementation sort of just stops streaming the message and starts streaming an error message. considered a few options, none of them seem to make much sense: Put all the relevant data in memory and then only stream the message itself. Do a double-take, so see if it works out with a fake stream and then do the real stream. Stream to a disk first and then use a file input stream to stream to the client

Data Validation Data validation is the process of ensuring that user input is clean, correct, and useful. Typical validation tasks are: has the user filled in all required fields? has the user entered a valid date? has the user entered text in a numeric field? Most often, the purpose of data validation is to ensure correct user input. Validation can be defined by many different methods, and deployed in many different ways. Server side validation is performed by a web server, after input has been sent to the server. Client side validation is performed by a web browser, before input is sent to a web server.

JavaScript Form Validation HTML form validation can be done by JavaScript. If a form field (fname) is empty, this function alerts a message, and returns false, to prevent the form from being submitted:

Example Programe <!DOCTYPE html> <html> <head> <script> function validateForm() { var x = document.forms["myForm"]["fname"].value; if (x == "") { alert("Name must be filled out"); return false; } </script> </head> <body> <form name="myForm" action="/action_page_post.php" onsubmit="return validateForm()" method="post"> Name: <input type="text" name="fname"> <input type="submit" value="Submit"> </form> </body> </html> OUTPUT : ?

The server has processed your input and returned this answer. Output: Post Data Your input was received as: fname=SF The server has processed your input and returned this answer.

Another Example Program <!DOCTYPE html> <html> <body> <h1>JavaScript Can Validate Input</h1> <p>Please input a number between 1 and 10:</p> <input id="numb"> <button type="button" onclick="myFunction()">Submit</button> <p id="demo"></p> <script> function myFunction() { var x, text; // Get the value of the input field with id="numb" x = document.getElementById("numb").value; // If x is Not a Number or less than one or greater than 10 if (isNaN(x) || x < 1 || x > 10) { text = "Input not valid"; } else { text = "Input OK"; } document.getElementById("demo").innerHTML = text; </script> </body> </html> Output : ?

Output: Input not valid JavaScript Can Validate Input Please input a number between 1 and 10:   Input not valid

Thank You,