Wednesday, 25 February 2015

Java (Characteristics of Java, How Do JSP Pages Work?, Servlets Architecture:)


Java is a programming language originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is a general-purpose, concurrent, class-based, object-oriented language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere". Java is currently one of the most popular programming languages in use, particularly for server-client web applications.



 Characteristics of Java


Platform neutral language – Java programs are platform neutral, this means program written in Java can be used on any computer running any operating system, this is possible by the help of java virtual machine.

Object-orientated programming language – In java programming language all the elements are object except the primitive data types.

Strongly-typed programming language -  Java is strongly-typed programming language, means we must defined the type of the variable before using it and conversion to other objects is relatively strict, it must be done in most cases explicitly by the programmer.

Compiled and Interpreted language – Usually a computer programming language can be either compiled or interpreted, but in case of  Java both of the approach is combined, thus it makes java a two stage system. In first stage source code is transferred into the bytecode format which is platform neutral. These bytecode instructions will be interpreted by the Java Interpreter in second stage.

Automatic memory management -  Java programming language has the in built memory management capabilities, thus allocation and de-allocation for creating new objects is handled by java. Java program does not have direct access to the memory. There is a garbage collector deletes objects automatically which is not active in the program.

JavaServer Pages (JSP) is a server-side programming technology that enables the creation of dynamic, platform-independent method for building Web-based applications. JSP have access to the entire family of Java APIs, including the JDBC API to access enterprise databases.



How Do JSP Pages Work?

 


Servlets provide a component-based, platform-independent method for building Web-based applications, without the performance limitations of CGI programs. Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases.


Servlets Architecture:


Following diagram shows the position of Servelts in a Web Application.



MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns.

    Model - Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.

    View - View represents the visualization of the data that model contains.

    Controller - Controller acts on both Model and view. It controls the data flow into model object and updates the view whenever data changes. It keeps View and Model separate.


Friday, 23 January 2015

Creating an HTML Push Button

 

The HTML <button> tag is used for creating a button within HTML form.

 

 

Specific Attributes

The HTML <button> tag also supports following additional attributes:


AttributeValueDescription
autofocus html-5autofocusSpecifies that the button should have input focus when the page loads.
disabledhtml-5disabledSpecifies the button is disabled.
form html-5form_idSpecifies the forms to which button belongs.
formaction html-5URLSpecifies the link where the form submits.
formenctype html-5application
multipart/form-data
text/plain
Specifies how the form data is encoded before sending it to server.
formmethod html-5get
post
Specifies how to send form data.
formnovalidatehtml-5formnovalidateSpecifies that the form data should not be validated.
formtarget html-5_blank
_self
_parent
_top
Specifies where the response should be validated.
name nameSpecifies the button name.
type button
reset
submit
Specifies the button type.
value textSpecifies button's initial value.

Event Attributes

This tag supports all the event attributes described in - HTML Events Reference

Browser Support


ChromeFirefoxIEOperaSafari
YesYesYesYesYes