Docsity

Internet Application developement, Essay, Lecture notes, VINOD, Essays (high school) of Web Application Development

Toggle sidebar
bg1
Internet Application
Development
(BCA Part-III)
Shipra Rastogi
GNIIT, 'A' Level
Lecturer
Deptt. of Information Technology
Biyani Girls College, Jaipur
Hastlipi, Jaipur
Syllabus
B.C.A. Part-III
Internet Application Development
HTML Fundamentals : Introduction to HTML, Creating HTML Pages,
incorporating
Horizontal Rules and Graphical Elements, Hyper-links, Creating HTML Tables,
Creating HTML Forms, HTML and Image Techniques, HTML and Page
Accessibility
Introduction to Java : History, Java Features, JVM, Java vs C++, Java and
WWW, Java
and HTML, JDK tools.
Language Features : Data Types- Primitives, Operators and Expressions,
Type casting
and conversion, Control flow.
Classes and Objects : Object References, static members, Constructor call
orders, Issues
with super, Wrapper classes, Compatible Object Referencing, Memory
management,
Garbage collection.
Packages and Interfaces : Access specifies, Packages and subsystems,
Import
dependency, Interfaces, Abstractness in java, Basics on of Interfaces, Use of
Interfaces,
Examples on interfaces, other modifiers final- The three manifestations
transient, static,
volatile.
Exception handling in Java : Exception raising & handling, Exception
classes,
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b

Partial preview of the text

Download Internet Application developement, Essay, Lecture notes, VINOD and more Essays (high school) Web Application Development in PDF only on Docsity!

Internet Application

Development

(BCA Part-III)

Shipra Rastogi

GNIIT, 'A' Level

Lecturer

Deptt. of Information Technology

Biyani Girls College, Jaipur

Hastlipi, Jaipur

Syllabus

B.C.A. Part-III

Internet Application Development

HTML Fundamentals : Introduction to HTML, Creating HTML Pages, incorporating Horizontal Rules and Graphical Elements, Hyper-links, Creating HTML Tables, Creating HTML Forms, HTML and Image Techniques, HTML and Page Accessibility Introduction to Java : History, Java Features, JVM, Java vs C++, Java and WWW, Java and HTML, JDK tools. Language Features : Data Types- Primitives, Operators and Expressions, Type casting and conversion, Control flow. Classes and Objects : Object References, static members, Constructor call orders, Issues with super, Wrapper classes, Compatible Object Referencing, Memory management, Garbage collection. Packages and Interfaces : Access specifies, Packages and subsystems, Import dependency, Interfaces, Abstractness in java, Basics on of Interfaces, Use of Interfaces, Examples on interfaces, other modifiers final- The three manifestations transient, static, volatile. Exception handling in Java : Exception raising & handling, Exception classes,

Throwing exceptions, Try-catch-finally, Exception propagation. Runtime Exceptions, User defined Exceptions, Examples. I/O in Java : Concept of Streams, Byte steams and Character streams, Random Access File, File and File Descriptor, Object Serialization and Persistence. AWT based effective GUI in Java : Detailed overview of AWT classes, Graphics primitives and UI components, Layout features, Standalone GUI applications, Layout Managers, Implementation of event driven mechanism, Delegation of even model, Listeners and Adapters, Inner classes. Applets : Introduction to Applet coding, Applet life cycle, Graphics facility, Color and Font, Passing parameters to applets, Applet context, Inter Applet Communication. Threading in Java : Fundamentals of Multi-threading Java coding with Thread classes, thread Management in Java, Implicit wait, using Runnable interface, Thread Management in Java, Implicit wait, Using runnable interface, Thread Synchronization, inter thread communication.

Overview of Networking in java : URL class and its usage through connection, Sockets based connectivity, TCP/IP Sockets and server sockets, Datagram Sockets. Java Database connectivity : JDBC Architecture, JDBC API 2.0. Java Script Fundamentals : Introduction to Java Script, Working with Variables and Data Functions, Method and Events, Controlling Program Flow. The Java Script Object Model, Java Script Language Objects Developing Interactive Forms, Cookies and Java Script Security, Controlling Frames in Java Script, Client-side Java Script, Custom Java script, Objects.

Content

S.No. Name of Topic Page No.

1. HTML Fundamentals 9- 1.1 Introduction to HTML 1.2 Creating HTML Pages 1.3 Incorporating Horizontal Rules

11.2 JDBC API

12. Java Script Fundamentals 93- 12.1 Java Script Object Model 12.2 Frames 12.3 Interactive Forms 12.4 Cookies 12.5 Custom JavaScript Objects

Chapter-

HTML Fundamentals Q.1. What is HTML? OR Explain the use of HTML? Ans.: HTML , an abriviation of^ HyperText Markup Language , is the predominant markup language for web pages. It provides a means to describe the structure of text-based information in a document — by denoting certain text as links, headings, paragraphs, lists, and so on — and to supplement that text with interactive forms , embedded images , and other objects. HTML is written in the form of tags, surrounded by angle brackets. HTML can also describe, to some degree, the appearance and semantics of a document, and can include embedded scripting language code (such as JavaScript) which can affect the behavior of Web browsers and other HTML processors. Definition : The Hyper Text Markup Language (HTML) is a simple data format used to create hypertext documents that are portable from one platform to another. HTML documents are SGML documents with generic semantics that are appropriate for representing information from a wide range of domains. HTML is also often used to refer to content in specific languages, such as a MIME type text/html, or even more broadly as a generic term for HTML, whether in its XML-descended form (such as XHTML 1.0 and later) or its form descended directly from SGML (such as HTML 4.01 and earlier). By convention, HTML format data files use a file extension .html or .htm. Q.2. How to create HTML Pages? Ans.: Elements are the basic structure for HTML markup. Elements have two basic

properties: attributes and content. Each attribute and each element's content has certain restrictions that must be followed for an HTML document to be considered valid. An element usually has a start tag (e.g. ) and an end tag (e.g. ). The element's attributes are contained in the start tag and content is located between the tags (e.g. Content). Some elements, such as
, do not have any content and must not have a closing tag. Listed below are several types of markup elements used in HTML.

Structural markup describes the purpose of text. For example, Golf establishes "Golf" as a second-level heading, which would be rendered in a browser in a manner similar to the "HTML markup" title at the start of this section. Structural markup does not denote any specific rendering, but most Web browsers have standardized on how elements should be formatted. Text may be further styled with Cascading Style Sheets (CSS). Presentational markup describes the appearance of the text, regardless of its function. For example boldface indicates that visual output devices should render "boldface" in bold text, but gives no indication what devices which are unable to do this (such as aural devices that read the text aloud) should do. In the case of both bold and italic, there are elements which usually have an equivalent visual rendering but are more semantic in nature, namely strong emphasis and emphasis respectively. It is easier to see how an aural user agent should interpret the latter two elements. However, they are not equivalent to their presentational counterparts: it would be undesirable for a screen-reader to emphasize the name of a book, for instance, but on a screen such a name would be italicized. Most presentational markup elements have become deprecated under the HTML

specification, in favor of CSS based style design. Hypertext markup links parts of the document to other documents. HTML up through version XHTML 1.1 requires the use of an anchor element to create a hyperlink in the flow of text: Wikipedia. However, the href attribute

OR

Explain different controls that are placed on HTML Forms? Ans.: Forms :^ A form is a template for a form data set and an associated method and action L. A form data set is a sequence of name/value pair^ fields. The names are specified on the NAME attributes of form input elements, and the values are given initial values by various forms of markup and edited by the user. The

resulting form data set is used to access an information service as a function of the action and method. Forms elements can be mixed in with document structuring elements. For example, a PRE element may contain a^ FORM^ element, or a^ FORM^ element may contain lists which contain INPUT elements. This gives considerable flexibility in designing the layout of forms. Form processing is a level 2 feature. Form Elements : Form (FORM) : The FORM element contains a sequence of input elements, along with document structuring elements. The attributes are : F 0 B 7

F 0 2 0 ACTION :^ Specifies the action URL for the form. The action URL of a form defaults to the base URI of the document. F 0 B 7

F 0 2 0 METHOD :^ Selects a method of accessing the action L. The set of applicable methods is a function of the scheme of the action L of the form. F 0 B 7

F 0 2 0 ENCTYPE :^ Specifies the media type used to encode the name/value pairs for transport, in case the protocol does not itself impose a format. Input Field (INPUT) : The INPUT element represents a field for user input. The TYPE attribute discriminates between several variations of fields. The INPUT element has a number of attributes. The set of applicable attributes depends on the value of the TYPE attribute. Text Field (INPUT TYPE=TEXT) : The default vaule of the TYPE attribute is `TEXT', indicating a single line text entry field. (Use the TEXTAREA element for multi-line text fields.) Required attributes are : NAME : Name for the form field corresponding to this element. The optional attributes are : F 0 B 7

F 0 2 0 MAXLENGTH :^ Constrains the number of characters that can be entered into a text input field. If the value of MAXLENGTH is greater the the value

of the SIZE attribute, the field should scroll appropriately. The default number of characters is unlimited. F 0 B 7

F 0 2 0 SIZE :^ Specifies the amount of display space allocated to this input^ field according to its type. The default depends on the user agent. F 0 B 7

F 0 2 0 VALUE :^ The initial value of the^ field. For Example :

Street Address:

Postal City code:
Zip Code:
Password Field (INPUT TYPE=PASSWORD) : An INPUT element with `TYPE=PASSWORD' is a text field as above, except that the value is obscured as it is entered. For example :

Name: Password: **Check Box (INPUT TYPE=CHECKBOX) :** An _INPUT_ element with `TYPE=CHECKBOX' represents a boolean choice. A set of such elements with the same name represents an n-of-many choice field. Required attributes are : F 0 B 7

F 0 2 0 NAME :^ Symbolic name for the form^ field corresponding to this element or group of elements. F 0 B 7

F 0 2 0 VALUE^ : The portion of the value of the^ field contributed by this element. Optional attributes are : F 0 B 7

F 0 2 0 CHECKED :^ Indicates that the initial state is on. For example :

What flavors do you like? Vanilla
Strawberry
Chocolate
**Radio Button (INPUT TYPE=RADIO) :** An _INPUT_ element with `TYPE=RADIO' represents a boolean choice. A set of such elements with the same name represents a 1-of-many choice field. The _NAME_ and _VALUE_ attributes are required as for check boxes. Optional attributes are : F 0 B 7

F 0 2 0 CHECKED :^ Indicates that the initial state is on. At all times, exactly one of the radio buttons in a set is checked. If none of the INPUT elements of a set of radio buttons specifies `CHECKED', then the user agent must check the^ first radio button of the set initially. For example :

Which is your favorite? Vanilla

**Selection (SELECT) :** The _SELECT_ element constrains the form field to an enumerated list of values. The values are given in _OPTION_ elements. Attributes are : **MULTIPLE :** Indicates that more than one option may be included in the value. **NAME :** Specifies the name of the form field. **SIZE :** Specifies the number of visible items. Select fields of size one are typically pop-down menus, whereas select fields with size greater than one are typically lists. For example :

The initial state has the first option selected, unless a SELECTED attribute is present on any of the OPTION elements. Option (OPTION) : The Option element can only occur within a Select element. It represents one choice, and has the following attributes : SELECTED : Indicates that this option is initially selected. VALUE : indicates the value to be returned if this option is chosen. The field value defaults to the content of the OPTION element. The content of the OPTION element is presented to the user to represent the option. It is used as a returned value if the VALUE attribute is not present. Text Area (TEXTAREA) : The TEXTAREA element represents a multi-line text field. Attributes are : COLS : The number of visible columns to display for the text area, in characters. NAME : Specifies the name of the form field. ROWS : The number of visible rows to display for the text area, in characters. For example :

The content of the TEXTAREA element is the^ field's initial value.

Typically, the ROWS and COLS attributes determine the visible dimension of the field in characters. The field is typically rendered in a fixed-width font. HTML user agents should allow text to extend beyond these limits by scrolling as needed. Q.5. How forms are submitted in HTML? Ans.: Form Submission :^ An HTML user agent begins processing a form by presenting the document with the fields in their initial state. The user is allowed to modify the fields, constrained by the field type etc. When the user indicates that the form should be submitted (using a submit button or image input), the form data set is processed according to its method, action URL and enctype. When there is only one single-line text input field in a form, the user agent should accept Enter in that^ field as a request to submit the form. The default encoding for all forms is application/x-www-form-urlencoded'. A form data set is represented in this media type as follows : (1) The form field names and values are escaped: space characters are replaced by+', and then reserved characters are escaped as per [URL]; that is, non-alphanumeric characters are replaced by %HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks, as in multi-line text field values, are represented as CR LF pairs, i.e.%0D%0A'. (2) The fields are listed in the order they appear in the document with the name separated from the value by =' and the pairs separated from each other by&'. Fields with null values may be omitted. In particular, unselected radio buttons and checkboxes should not appear in the encoded data, but hidden fields with VALUE attributes present should. Query Forms METHOD=GET : If the processing of a form is idempotent (i.e. it has no lasting observable effect on the state of the world), then the form method should be GET'. Many database searches have no visible side-effects and make ideal applications of query forms. To process a form whose action URL is an HTTP URL and whose method isGET', the user agent starts with the action URI and appends a `?' and the form

data set, in `application/x-www-form-urlencoded' format as above. The user agent then traverses the link to this URI just as if it were an anchor. Forms with Side-Effects (METHOD=POST) : If the service associated with the processing of a form has side effects (for example, modification of a database or

Microsystems, is widely believed to have been the person to conceive of the idea of a programming language that later became Java. In late 1970's, Joy wanted to design a language that combined the best features of MESA and C. In an attempt to re-write the UNIX operating system in 1980's, Joy decided that C++ was inadequate for the job. A better tool was needed to write short and effective programs. It was this desire to invent a better programming tool that swayed Joy, in 1991, in the direction of Sun's "Stealth Project" - as named by Scott McNealy, Sun's president. In January of 1991 , Bill Joy, James Gosling, Mike Sheradin, Patrick Naughton (formerly the project leader of Sun's Open Windows user environment), and several other individuals met in Aspen, Colorado for the first time to discuss the ideas for the Stealth Project. The goal of the Stealth Project was to do research in the area of application of computers in the consumer electronics market. The vision of the project was to develop "smart" consumer electronic devices that could all be centrally controlled and programmed from a handheld- remotecontrol- like device. According to Gosling, "the goal was ... to build a system that would let us do a large, distributed, heterogeneous network of consumer electronic devices all talking to each other." With this goal in mind, the stealth group began work. There were several criteria that Oak had to meet in order to satisfy the project objective given the consumer electronics target market. Given the wide array of manufacturers in the market, Oak would have to be completely platform independent, and function seamlessly regardless of the type of CPU in the device. For this reason, Oak was designed to be an interpreted language, since it would be practically impossible for a complied version to run on all available platforms. To facilitate the job of the interpreter, Oak was to be converted to an intermediate "byte-code" format which is then passed around across the network, and executed/interpreted dynamically. Today, with technology such a part of our daily lives, we take it for granted that

we can be connected and access applications and content anywhere, anytime. Because of Java, we expect digital devices to be smarter, more functional and more entertaining. In the early 90s, extending the power of network computing to the activities of everyday life was a radical vision. In 1991, a small group of Sun engineers called

the "Green Team" believed that the next wave in computing was the union of digital consumer devices and computers. Led by James Gosling, the team worked around the clock and created the programming language that would revolutionize our world – Java. The Green Team demonstrated their new language with an interactive, handheld home-entertainment controller that was originally targeted at the digital cable television industry. Unfortunately, the concept was much too advanced for them at the time. But it was just right for the Internet, which was just starting to take off. In 1995, the team announced that the Netscape Navigator Internet browser would incorporate Java technology. Today, Java not only permeates the Internet, but also is the invisible force behind many of the applications and devices that power our day-to-day lives. From mobile phones to handheld devises, games and navigation systems to e- business solutions, Java is everywhere. Q.8. How Java and World Wide Web connected with each other? Ans.: Java and the World Wide Web : A significant advance in Web technology was Sun Microsystems' Java platform. It enables Web pages to embed small programs (called applets) directly into the view. These applets run on the end-user's computer, providing a richer user interface than simple Web pages. Java clientside applets never gained the popularity that Sun had hoped for a variety of reasons, including lack of integration with other content (applets were confined to small boxes within the rendered page) and the fact that many computers at the time were supplied to end users without a suitably installed Java Virtual

browser in the world. Later, Microsoft also announced that they would support Java in their Internet Explorer web browser, further solidifying Java's role in the World Wide Web. Q.9. What are the basic features of Java Language? Ans.: Java Features : Here we list the basic features that make Java a powerful and popular programming language : F 0 B 7F 0 2 0 Platform Independence : o The Write-Once-Run-Anywhere ideal has not been achieved (tuning for different platforms usually required), but closer than with other languages. F 0 B 7F 0 2 0 Object Oriented : o Object oriented throughout - no coding outside of class definitions, including main(). o An extensive class library available in the core language packages. F 0 B 7F 0 2 0 Compiler/Interpreter Combo : o Code is compiled to bytecodes that are interpreted by a Java virtual machines (JVM). o This provides portability to any machine for which a virtual machine has been written. o The two steps of compilation and interpretation allow for extensive code checking and improved security. F 0 B 7F 0 2 0 Robust : o Exception handling built-in, strong type checking (that is, all data must be declared an explicit type), local variables must be initialized. F 0 B 7F 0 2 0 Several dangerous features of C & C++ eliminated: o No memory pointers

o No preprocessor o Array index limit checking F 0 B 7F 0 2 0 Automatic Memory Management o Automatic garbage collection - memory management handled by JVM. F 0 B 7F 0 2 0 Security o No memory pointers o Programs runs inside the virtual machine sandbox. o Array index limit checking o Code pathologies reduced by _ bytecode verifier - checks classes after loading _ class loader - confines objects to unique namespaces. Prevents loading a hacked "java.lang. Security Manager" class, for example. _ security manager - determines what resources a class can

access such as reading and writing to the local disk. F 0 B 7F 0 2 0 Dynamic Binding o The linking of data and methods to where they are located, is done at run-time. o New classes can be loaded while a program is running. Linking is done on the fly. o Even if libraries are recompiled, there is no need to recompile code that uses classes in those libraries. This differs from C++, which uses static binding. This can result in fragile classes for cases where linked code is changed and memory pointers then point to the wrong addresses. F 0 B 7F 0 2 0 Good Performance : o Interpretation of bytecodes slowed performance in early versions, but advanced virtual machines with adaptive and just-in-time compilation and other techniques now typically provide performance up to 50% to 100% the speed of C++ programs. F 0 B 7F 0 2 0 Threading :

o Lightweight processes, called threads, can easily be spun off to perform multiprocessing. o Can take advantage of multiprocessors where available. o Great for multimedia displays. F 0 B 7F 0 2 0 Built-in Networking : o Java was designed with networking in mind and comes with many classes to develop sophisticated Internet communications. Features such as eliminating memory pointers and by checking array limits greatly help to remove program bugs. The garbage collector relieves programmers of the big job of memory management. These and the other features can lead to a big speedup in program development compared to C/C++ programming. Q.11. What is JVM? Ans.: Java Virtual Machine : A Java Virtual Machine ( JVM ) is a set of computer software programs and data structures which use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode. This language conceptually represents the instruction set of a stackoriented, capability architecture. Java Virtual Machines operate on Java bytecode, which is normally (but not necessarily) generated from Java source code; a JVM can also be used to implement programming languages other than Java. For example, Ada source

Command-line arguments do not include the program name. Command-line arguments do not include the program name. Main method cannot return a value. Main function can return a value. No global variables. Global variables. Character escape sequences can appear in a program. Character escape sequences must appear in a string or character literal. Cannot mask identifiers through scope. Can mask identifiers through scope. Pure object-oriented language. Hybrid between procedural and object-

oriented. All functions (methods) are part of a class. Can have stand-along functions. No multiple inheritance. Multiple inheritance. Formal interface specifications. No formal interface specifications. No parameterized type. Templates as parameterized type. Java versus C++: Object-Oriented Programming Context Java C++ No operator overloading. Operator overloading. All methods (except final methods) are dynamically bound. Virtual functions are dynamically bound. Q.13. What are the Fundamental JDK Tools? Ans.: These tools are the foundation of the JDK. They are the tools you use to create and build applications. Tool Name Brief Description javac The compiler for the Java programming language. java The launcher for Java applications. In this release, a single launcher is used both for development and deployment. The old deployment launcher, jre , is no longer provided. javadoc API documentation generator. See Javadoc Tool page for doclet and taglet APIs. apt Annotation processing tool. See Annotation Processing Tool for program annotation processing. appletviewer Run and debug applets without a web browser. jar Create and manage Java Archive (JAR) files. See Java Archive Files page for the JAR specification.

jdb The Java Debugger. See JPDA for the debugger architecture specifications. javah C header and stub generator. Used to write native methods.

javap Class file disassembler. extcheck Utility to detect Jar conflicts.

Chapter-

Language Features

Q.1. Explain data types in Java? OR How many primitive data types are there in Java? Ans.: The Java programming language is strongly-typed, which means that all variables must first be declared before they can be used. This involves stating the variable's type and name: int gear = 1; Doing so tells your program that a field named "gear" exists, holds numerical data, and has an initial value of "1". A variable's data type determines the values it may contain, plus the operations that may be performed on it. In addition to int, the Java programming language supports seven other primitive data types. A primitive type is predefined by the language and is named by a reserved keyword. Primitive values do not share state with other primitive values. The eight primitive data types supported by the Java programming language are : F 0 B 7F 0 2 0 Byte : The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). F 0 B 7F 0 2 0 Short : The short data type is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32, (inclusive). As with F 0 B 7F 0 2 0 Int : The int data type is a 32-bit signed two's complement integer. It has a minimum value of -2,147,483,648 and a maximum value of 2,147,483, (inclusive). For integral values, this data type is generally the default choice unless there is a reason (like the above) to choose something else F 0 B 7F 0 2 0 Long : The long data type is a 64-bit signed two's complement integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive). Use this data type when you need a range of values wider than those provided by int. F 0 B 7F 0 2 0 Float : The float data type is a single-precision 32-bit IEEE 754 floating