Sunday, February 21, 2016

Evolution of Web Application


Evolution of Web Application
Introduction:
                   Web server purpose has evolved from static to dynamic applications. These developments became important due to some deficiencies in previously web site design.
                    
For example, to put more of commerce processes on the web, whether in business-to-consumer or business-to-business markets, usual web site design technologies are not enough.

Core Issue:

       The major issues, that every developer faces when developing web applications, are:
  
 Scalability:
          A successful site will have more users and as the number of users is increasing fast, the web applications have to scale correspondingly,

Integration of data and business logic:
         The web is a new way to conduct business, and so it should be able to use the same middle-tier and data-access code

Manageability:   
         Adding a personal touch to the web page becomes an essential factor to keep our customer coming back again. Knowing their preferences, allowing them to configure the information they view, recall their past transactions or frequent search keywords are all significant in providing feedback and interaction from what is otherwise a fairly one-sided conversation 

Characteristics of web Application:

           Apart from common needs for a business-oriented web site, the necessity for new technologies to create robust, dynamic and compact server-side web applications has been realized.

The major characteristics of dynamic web server applications are:

Serve HTML and XML, and stream data to the web client
* Separate presentation, logic and data 
* Interface to databases, other Java applications, directory and mail services.
* Make use of application server middle ware to provide transactional support.
* Track client sessions.   

Role of JAVA for Server Applications:
                 
                The J2EE specification provides a platform for enterprise applications, with complete API support for enterprise code and guarantees of portability between server implementations. Also it brings a clear division between code which deals with presentation, business logic and data.

The J2EE specification meets the requirements of web applications because it provides:

*  Affluent via servlets and built-in support for and EJBs. interaction with           a sessions available in both servlets web server
*The use of EJBs to mirror the user interaction with data by providing automatic session and transaction support to EJBs operating in the EJB server.
* Entity EJBs to represent data as an object and seamless integration with the Java data access APIs   
*Flexible template-based output using JSP and XML 

            APIs mean that the final web page can be generated from a user input request, which was processed by a servlet or JSP and a session EJB, which represents the user's session with the server, using data extracted from a database and put into an entity EJB. 

              Thus, the Java revolution of portable code and open APIs is conjugal with an evolution in existing products such as database, application, mail and web servers. The wide availability of products to run Java applications on the server has made this a fast-moving and very competitive market, but the essential compatibility through specifications, standard APIs and class libraries has held. It makes server-side Java a very exciting area. 

JavaServer Pages - An Overview:

                     The JavaServer Pages specification provides web developers with a structure to build applications containing dynamic web content such as HTML, DHTML, XHTML and XML.
                    A JSP page is a text based document containing static HTML and dynamic actions which describe us how to process a response to the client in a more powerful and flexible manner.
                    Most of a JSP file is plain HTML but it also has, interspersed with it, special JSP tags.

There are many JSP tags such as:
* JSP directive denoted by tags and
* Directive includes the contents of the file sample.php in the response at that point. 

                    To process a JSP file, we need a JSP engine that can be connected with a web server or can be accommodated inside a web server.

                      Firstly when a web browser seeks a JSP file through an URL from the web server, the web server recognizes the .jsp file extension in the URL requested by the browser and understands that the requested resource is a JavaServer Page. Then the web server passes the request to the JSP engine. The JSP page is then translated into a Java class, which is then compiled into a servlet.

                    The translation and compilation phase occurs when the JSP file is requested for the first time, or if it undergoes any changes to the extent of getting re translated and recompiled. For each additional request of the JSP page thereafter, the request directly goes to the servlet byte code, which is already in memory.  

                   Thus when a request comes for a servlet, an init () method is called when the Servlet is first loaded into the virtual machine, to perform any global initialization that every request of the servlet will need. Then the individual requests are sent to a service () method, where the response is put together. 

                  The servlet creates a new thread to run service () method for each request. The request from the browser is converted into a Java object of type HttpServletRequest, which is passed to the Servlet along with an HttpServletResponse object that is used to send the response back to the browser. The servlet code performs the operations specified by the JSP elements in the .jsp file.



  
 

Java Server Pages

  








Java Server Pages (JSP) technology enables Web developers and designers to rapidly develop and easily maintain, information- rich, dynamic Web pages that leverage exiting business systems.

As part of the Java technology family, JSP technology enables rapid development of Web-based applications that are platform independent.

JSP technology separates the user interface from content generation, enabling designers to change the overall page layout without altering underlying dynamic content.

 The prerequisites are :
 * HTML .You should be able to to put together HTML pages.
 * Java . You should be able to program in Java.