Professional Documents
Culture Documents
Introduction to Web
The web is a complex, international, cross platform, cross language, cross cultural mesh of servers, clients, users, databases and quite a few artificial intelligence all connected to each other and capable to talk to each other. The web is owned by no single entity because it cannot be considered as a thing but as a process, action and communication medium. Initially web was originated to fulfill the need for a collaborative knowledge sharing tool" (to support scientific work) in an international context. Now it is providing access to information, news, email, shopping and entertainment. For different people web has different meaning, to some people it is like a newspaper, magazine or a library of any kind of books. To some people it is a radio or TV where they can access any latest information around all over the world. To some people it serves like a communication medium. To some people it is an open market where they can get anything of their interest without going out of their house. So it can be concluded that its domain is not restricted to the boundations.
N times into the memory, due to which a lot of system memory will be wasted and also the speed of the server will suffer. Thus the CGI script creates the problem of System Resources and hence make the speed of the server very slow.
Comentario [SSG1]: Provide more explanation as to how exactly the system resources are wasted.
JSP pages are accessed fast then ASP pages because after first compilation JSP pages are not compiled again if there is no modification in the JSP source file, while ASP are interpreted by the .dll file residing at the server each time new request comes from the user. JSP 1.2 specification adds a new functionality to JSP pages called the Extensible Tags. The developer can create his own tags and can use them in any number of JSP pages. ASP does not favor this feature. In brief the ASP and JSP technologies can be compared as the following table: Criteria of comparison Scripting languages Web server ASP VB script, Jscript IIS PWS JSP Java Any web server including Apache, IIS, Netscape server Solaris Operating environment Microsoft windows, Unix, Linux Beans, EJBs, extensible tag library Yes(JDBC API) Yes (using JDBC API) Yes
Platforms
Microsoft windows
Components Compatibility with the legacy database Data source compatibility Custom tag extension
* Com Connecter can be developed using any Component supporting language like VB, VC to connect to the legacy database.
1.3
JSP Architecture:
JSP is a part of the Java platform Enterprise Edition (J2EE), which is the Java architecture for developing multi-tier enterprise applications. A JSP page is executed by a JSP engine, which is installed in a web server or a JSP enabled application server. The JSP request response involves a four step architecture which can be described as follows: When JSP engine first time receives the request for some JSP page it parses the JSP file and create the Java source code file. The second step is the compilation of this source code into the class file. This is the Servlet files and is handled by the Servlet engine. The third step involved is the execution of the Servlet. In final step the servlet executes and response is send back to the client.
The first and second steps occur only once since the jsp is loaded or updated and third step is performed once since the server was last started. Once the Servlet is executed it becomes available there for the life cycle of the Java Virtual Machine, hence there is no need for its execution again and again. Response Client JSP Engine
Request Response
JSP file
Fig 1.1: The Figure shows the flow of request and response when a jsp page is called.
1.4.
Client Fig 1.2 Simple Two -Tier Architecture This approach has the following advantages:
Server
1. It is Simple and faster to program. 2. The developer can easily generate dynamic content based on request and state of response. The main problem with the approach were: 1. It is difficult to maintain changes. 2. It is very difficult to reuse the presentation and business logic. 3. No manageable for internet applications
The third layer, the data layer consists of the data required for the application. This data can be any standard database such as Oracle, Sybase, a set of XML documents or a directory service like LDAP. The 3-Tier Architecture can be better understood by the following diagram:
Data base
User Interface
Application Layer
XML Document
LDAP
User Interface: Handles the user interaction with the application. For example a Web browser. Presentation logic: defines what the user interface displays and how a user's requests are handled. Business Logic: handles the application's business rules through the interaction with the application's data. Infrastructure Services: provides additional functionality required by the application components, such as messaging, transaction support etc. Data layer: the data regarding the application resides in this layer.
Browser
Data base
XML Documents
LDAP
When the browser sends a request to the server for the JSP page, the server forwards the request to the jsp engine. Jsp engine translates the jsp page into java Source code that is converted into a Servlet class by the servlet engine. This conversion of the jsp file and compilation occurs only when the file is first called after uploading or it is updated. After the first request other requests for the page directly goes to the Servlet Byte Code. The JSP engine is installed on a web server (Apache-Tomcat) or on the application server (Weblogic). JSP engine must support HTTP as a protocol for requests and responses, but an engine may also support additional request / response protocols. The default request and response objects are of type HttpServletRequest and HttpServletResponse respectively.
Summary: