You are on page 1of 11

INTRODUCTION TO TECHNOLOGY USED

FRONT END

JAVA:

Java programming language was originally developed by Sun Microsystems, which was

initiated by James Gosling and released in 1995 as core component of Sun Microsystems’s

Java platform (Java 1.0 [J2SE]). As of December 08 the latest release of the Java Standard

Edition is 6 (J2SE). With the advancement of Java and its wide spread popularity, multiple

configurations were built to suite various types of platforms. Ex: J2EE for Enterprise

Applications, J2ME for Mobile Applications. Sun Microsystems has renamed the new J2

versions as Java SE, Java EE and Java ME respectively. Java is:

Object Oriented: In java everything is an Object. Java can be easily extended since it is

based on the Object model. Although in􀀲uenced by its predecessors, Java was not

designed to be source-code compatible with any other language. This allowed the Java team

the freedom to design with a blank slate. One outcome of this was aclean, usable, pragmatic

approach to objects. Borrowingliberally from many seminal object-software

environments of the last few decades, Java manages tostrike a balance between the purist’s

“everything is anobject” paradigm and the pragmatist’s “stay out of my

way” model. The object model in Java is simple andeasy to extend, while primitive types,

such as integers,are kept as high-performance nonobjects.

Platform independent: Unlike many other programming languages including C and C++

when Java is compiled, it is not compiled into platform specific machine, rather into platform
independent byte code. This byte code is distributed over the web and interpreted by virtual

Machine (JVM) on whichever platform it is being run.

Simple: Java is designed to be easy to learn. If you understand the basic concept of OOP

java would be easy to master. Java was designed to be easy for the professional

programmer to learn and use e􀀵ectively. Assuming that you have some programming

experience, you will not and Java hard to master. If you already understand the

basic concepts of object-oriented programming, learning Java will be even easier. Best of all,

if you are an experienced C++ programmer, moving to Java will require very little e􀀵ort.

Because Java inherits theC/C++ syntax and many of the object-oriented features

of C++, most programmers have little trouble learning Java.

Secure: With Java's secure feature it enables to develop virus-free, tamper-free systems.

Authentication techniques are based on public-key encryption.

Architectural- neutral: Java compiler generates an architecture-neutral object file format

which makes the compiled code to be executable on many processors, with the presence Java

runtime system.

Portable: Being architectural neutral and having no implementation dependent aspects of the

specification makes Java portable. Compiler and Java is written in ANSI C with a clean

portability boundary which is a POSIX subset. Portability is a major aspect of the Internet

because there are many di􀀵erent types of computers and operating systems connected to it. If

a Java program were to be run on virtually any computer connected to the Internet, there

needed to be some way to enable that program to execute on di􀀵erent systems. For
example, in the case of an applet, the same applet must be able to be downloaded and

executed by the wide variety of CPUs, operating systems, and browsers connected to the

Internet. It is not practical to have di􀀵erent versions of

the applet for di􀀵erent computers. The same code must work on all computers. Therefore,

some means of generating portable executable code was needed. As you

will soon see, the same mechanism that helps ensure security also helps create portability.

Robust: Java makes an effort to eliminate error prone situations by emphasizing mainly on

compile time error checking and runtime checking. The multiplatformeenvironment of the

Web places extraordinary demands on a program, because the program must execute reliably

in a variety of systems. Thus, the ability to create robust programs was given a high priority

in the design of Java. To gain reliability, Java restricts you in a few key areas to force you to

􀀩nd your mistakes early in program development. At the

same time, Java frees you from having to worry about many of the most common causes of

programming errors. Because Java is a strictly typed language, it checks your code at compile

time. However, it also checks yourcode at run time. Many hard-to-track-down bugs that often

turn up in hard-to-reproduce run-time situationsare simply impossible to create in Java.

Knowing that what you have written will behave in a predictable way

under diverse conditions is a key feature of Java.

(In fact, deallocation is completely automatic, because Java provides garbage collection for

unused objects.) Exceptional conditions in traditional environments often arise in situations

such as division by zero or “􀀩le not found,” and they must be managed with clumsy and

hard-to-read constructs. Java helps in this area by providing object-oriented exception

handling. In a wellwritten Java program, all run-time errors can—anshould—be managed by

your program.
Multi-threaded: With Java's multi-threaded feature it is possible to write programs that can

do many tasks simultaneously. This design feature allows developers construct smoothly

running interactive applications. Java was designed to meet the real-world requirement of

creating interactive, networked programs. To accomplish this, Java supports multithreaded

programming, which allows you to write programs that do many things simultaneously. The

Java run-time system comes with an elegant yet sophisticated solution for multiprocess

synchronization that enables you to construct smoothly running interactive systems. Java’s

easy-to-use approach to multithreading allows you to think about the speci􀀩c behavior of

your program, not the multitasking

subsystem.

Interpreted: Java byte code is translated on the fly to native machine instructions and is not

stored anywhere. The development process is more rapid and analytical since the linking is

an incremental and light weight process. As described earlier, Java enables the creation of

crossplatform programs by compiling into an intermediate representation called Java

bytecode. This code can be executed on any system that implements the Java Virtual

Machine. Most previous attempts at cross-platform solutions have done so at the expense of

performance. As explained earlier, the Java bytecode was carefully designed so that it would

be easy to translate directlyinto native machine code for very high performance by using a

just-in-time compiler. Java run-time systems that provide this feature lose none of the

bene􀀩ts of the platform-independent code.

High Performance: With the use of Just-In-Time compilers Java enables high performance.
Distributed: Java is designed for the distributed environment of the internet. Java is

designed for the distributed environment of the Internet because it handles TCP/IP protocols.

In fact, accessing a resource using a URL is not much di􀀵erent from accessing a 􀀩le. Java

also supports Remote Method Invocation (RMI). This feature enables a program toinvoke

methods across a network.

Dynamic: Java is considered to be more dynamic than C or C++ since it is designed to adapt

to an evolving environment. Java programs can carry extensive amount of run-time

information that can be used to verify and resolve accesses to objects on run-time. Java

programs carry with them substantial amounts of run-time type information that is used to

verify and resolve accesses to objects at run time. This makes it possible to dynamically link

code in a safe and expedient manner. This is crucial to the robustness of the Java

environment, in which small fragments of bytecode may be dynamically updated on a

running system.

History of Java

James Gosling initiated the Java language project in June 1991 for use in one of his many set-

top box projects. The language, initially called Oak after an oak tree that stood outside

Gosling's office, also went by the name Green and ended up later renamed as Java, from a list

of random words. Sun released the first public implementation as Java 1.0 in 1995. It

promised Write Once, Run Anywhere (WORA), providing no-cost run-times on popular

platforms. On 13 November 2006, Sun released much of Java as free and open source

software under the terms of the GNU General Public License (GPL). On 8 May 2007 Sun

finished the process, making all of Java's core code free and open-source, aside from a small
portion of code to which Sun did not hold the copyright. Java was conceived by James

Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems,

Inc. in 1991. It took 18 months to develop the 􀀩rst working version. This language was

initially called “Oak,” but was renamed “Java” in 1995. Between the initial implementation

of Oak in the fall of 1992 and

the public announcement of Java in the spring of 1995, many more people contributed to the

design and evolution of the language. Bill Joy, Arthur van Ho􀀵, Jonathan Payne, Frank

Yellin, and Tim Lindholm were key contributors to the maturing of the original

prototype.

Popular Java Editors:


To write your java programs you will need a text editor. There are even more sophisticated

IDE available in the market. But for now, you can consider one of the following:

 Notepad: On Windows machine you can use any simple text editor like Notepad

(Recommended for this tutorial), Text Pad.

 Net beans: is a Java IDE that is open source and free which can be downloaded

fromhttp://www.netbeans.org/index.html.

 Eclipse: is also a java IDE developed by the eclipse open source community and can

be downloaded from http://www.eclipse.org/

Let us look at a simple code that would print the words Hello World.

public class MyFirstJavaProgram {

/* This is my first java program.

* This will print 'Hello World' as the output

public static void main(String []args) {


System.out.println("Hello World"); // prints Hello World

}}

Lets look at how to save the file, compile and run the program. Please follow the steps given

below:

 Open notepad and add the code as above.

 Save the file as: MyFirstJavaProgram.java.

 Open a command prompt window and go o the directory where you saved the class.

Assume its C:\.

 Type ' javac MyFirstJavaProgram.java ' and press enter to compile your code. If there

are no errors in your code the command prompt will take you to the next line.

( Assumption : The path variable is set).

 Now type ' java MyFirstJavaProgram ' to run your program.

 You will be able to see ' Hello World ' printed on the window.

C :>javac MyFirstJavaProgram.java

C :> java MyFirstJavaProgram

Hello World

 Basic Syntax: About Java programs, it is very important to keep in mind the

following points. Case Sensitivity - Java is case sensitive which means identifier

Hello and hello would have different meaning in Java.


 Class Names - For all class names the first letter should be in Upper Case. If

several words are used to form a name of the class each inner words first letter

should be in Upper Case. Example class MyFirstJavaClass.

 Method Names - All method names should start with a Lower Case letter. If

several words are used to form the name of the method, then each inner word's

first letter should be in Upper Case. Example public void myMethodName(),

 Program File Name - Name of the program file should exactly match the class

name. When saving the file you should save it using the class name (Remember

java is case sensitive) and append '.java' to the end of the name. (if the file name

and the class name do not match your program will not compile). Example :

Assume 'MyFirstJavaProgram' is the class name. Then the file should be saved

as'MyFirstJavaProgram.java' „h public static void main(String args[]) .

JSP (JAVA SERVER PAGES)

JSP (Java Server Pages) is a standard for developing interactive Web applications (pages

containing dynamic content). A JSP web page (recognizable by the .jsp extension) may

display different content based on certain parameters (information stored in a database, the
user preferences, ..), while a classic webpage (with the .htm or .html extension) will

continuously display the same information.JSP is actually a powerful scripting language

(interpreted language) executed on the server side (like CGI, PHP, ASP, ...) and not on the

client side (unlike scripts written in JavaScript or Java applets which run in the browser of the

user connected to a site).JSPs are integrated in a web page in HTML using special tags which

will notify the Web server that the code included within these tags are to be interpreted. The

result (HTML codes) will be returned to the client browser .Java Server Pages are part of a 3-

tier architecture: where a server supporting the Java Server Pages (generally referred to as

application server) will act as a mediatior between the client browser and a database

(generally referred to as data server). JSP provides the necessary elements for the connection

to the database management system and allow the manipulation of data through SQL.

A JavaServer Pages component is a type of Java servlet that is designed to fulfill the role of

a user interface for a Java web application. Web developers write JSPs as text files that

combine HTML or XHTML code, XML elements, and embedded JSP actions and

commands.

Using JSP, you can collect input from users through web page forms, present records from a

database or another source, and create web pages dynamically.

JSP tags can be used for a variety of purposes, such as retrieving information from a

database or registering user preferences, accessing JavaBeans components, passing control

between pages and sharing information between requests, pages etc.

WHY USE JSP?


JavaServer Pages often serve the same purpose as programs implemented using the

Common Gateway Interface (CGI). But JSP offer several advantages in comparison with the

CGI.

 Performance is significantly better because JSP allows embedding Dynamic Elements

in HTML Pages itself instead of having a separate CGI files.

 JSP are always compiled before it's processed by the server unlike CGI/Perl which

requires the server to load an interpreter and the target script each time the page is

requested.

 Java Server Pages are built on top of the Java Servlets API, so like Servlets, JSP also

has access to all the powerful Enterprise Java APIs, including JDBC, JNDI, EJB,

JAXP etc.

 JSP pages can be used in combination with servlets that handle the business logic, the

model supported by Java servlet template engines.

Finally, JSP is an integral part of Java EE, a complete platform for enterprise class

applications. This means that JSP can play a part in the simplest applications to the

most complex and demanding.

JQuery:-JQuery is a lightweight, "write less, do more", JavaScript library. The purpose of

jQuery is to make it much easier to use JavaScript on your website.jQuery takes a lot of

common tasks that require many lines of JavaScript code to accomplish, jQuery simplifies

HTML document traversing, event handling, animating, and Ajax interactions for rapid web

development and wraps them into methods that you can call with a single line of code.jQuery

also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM

manipulation. The jQuery library contains the following features:


 HTML/DOM manipulation

 CSS manipulation

 HTML event methods

 Effects and animations

 AJAX

 Utilities

You might also like