Simple MVC. An example: join.jsp <% String error = ""; String email = request.getParameter("email"); // do we have an email address if( email!=null )

Slides:



Advertisements
Similar presentations
Chapter 7 JavaScript: Introduction to Scripting. Outline Simple Programs Objects and Variables Obtaining User Input with prompt Dialogs – –Dynamic Welcome.
Advertisements

MWD1001 Website Production Using JavaScript with Forms.
Essentials for Design JavaScript Level One Michael Brooks
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Programming Paradigms and languages
Web Development with Karsten Schulz Terp-Nielsen Master Principal Sales Consultant Oracle Denmark.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
Creating a Form on a Web Page
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
DT211/3 Internet Application Development JSP: Processing User input.
JavaScript 101 Lesson 01: Writing Your First JavaScript.
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
Multiple Tiers in Action
DT228/3 Web Development JSP: Directives and Scripting elements.
Struts 2.0 an Overview ( )
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
UNIT-V The MVC architecture and Struts Framework.
Introduction to the Jakarta Struts Framework  The Topics: JavaServer Pages (JSP) Overview JSP Tags and Tag Libraries Overview Model – View – Controller.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
PHP: Hypertext Processor Fred Durao
4.1 JavaScript Introduction
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
HTML Forms and Scripts. Session overview What are forms? Static vs dynamic Client-side scripts –JavaScript.
BEST PRACTICES - Java By Configuration Use global-forwards/results Helps to avoid duplicate jsp files and redundancy forward mapping.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
INE1020 Introduction to Internet Engineering Tutorial 8 All about Lab 6.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
CSCI 6962: Server-side Design and Programming Validation Tools in Java Server Faces.
1 JavaScript E-Commerce Prof. Sheizaf Rafaeli
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Introduction to Applets CS 3505 Client Side Scripting with applets.
HTML Concepts and Techniques Fourth Edition Project 7 Creating a Form on a Web Page.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
Scripting Language A scripting language or script language is a programming language that supports the writing of scripts. The term script is typically.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
Introduction to HTML Part 3 Chapter 2. Learning Outcomes Identify how to design frames. Explain frames’ attributes. Describe the method on designing forms.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
JavaScript - A Web Script Language Fred Durao
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
Introduction to JavaScript CS101 Introduction to Computing.
Web Development 101 Presented by John Valance
Apache Struts. J2EE Web Application using MVC design pattern Why MVC? Separate components = easier maintenance – Model component holds object data – View.
Introduction to JavaScript Objects, Properties, Methods.
1 Server versus Client-Side Programming Server-SideClient-Side.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
13 Copyright © 2004, Oracle. All rights reserved. Adding Validation and Error Handling.
Javascript JavaScript is what is called a client-side scripting language:  a programming language that runs inside an Internet browser (a browser is also.
Lesson 30: JavaScript and DHTML Fundamentals. Objectives Define and contrast client-side and server-side technologies used to create dynamic content for.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
CS320 Web and Internet Programming Web Application and MVC Chengyu Sun California State University, Los Angeles.
Tutorial 10 Programming with JavaScript
MIS Professor Sandvig MIS 324 Professor Sandvig
Introduction to Struts
Web Systems Development (CSC-215)
Java Server Pages (JSP)
Unit 6 part 3 Test Javascript Test.
JavaScript: Introduction to Scripting
Struts BY: Tejashri Udavant..
Presentation transcript:

Simple MVC

An example: join.jsp <% String error = ""; String = request.getParameter(" "); // do we have an address if( !=null ) { // validate input... if( business.util.Validation.isValid ( ) ) { // store input... try { business.db.MailingList.Add ( ); } catch (Exception e) { error = "Error adding address to system. " + e; }

join.jsp – part 2 if( error.length()==0 ) { %> // redirect to welcome page... <% } } else { // set error message and redisplay page error = + " is not a valid address, try again."; } } else { = ""; } %>

join.jsp – part 3 Join Mailing List Enter your to join the group >

An example – comment * Heavy HTML and Java coupling The coder of the JSP file must be both a page designer and a Java developer. The result is often either terrible Java code or an ugly page, or sometimes both. * Java and JavaScript blur As the pages become larger, there can be a tendency to implement some JavaScript. When the JavaScript appears in a page, the script can get confused with the Java code. An example of a possible point of confusion is using client-side JavaScript to validate the field. * Embedded flow logic To understand the entire flow of the application, you have to navigate all of the pages. Imagine the spaghetti logic on a 100-page Web site. * Debugging difficulties In addition to being ugly to look at, HTML tags, Java code, and JavaScript code all in one page makes it difficult to debug problems. * Tight coupling Changes to business logic or data means possibly touching every page involved. * Aesthetics Visually, in large pages, this type of coding looks messy.

Struts jsp tag libs <!-- document.joinForm. .focus() // --> You write: Browser gets: The additional JavaScript sets the focus on the address field.

Struts MVC

implementation See code downloaded from

Struts 2

Struts 2