The HTTP (hypertext transfer protocol) is similar to many other Internet protocols such as SMTP (simple mail transfer protocol) and FTP (file transfer protocol), as HTP is a protocol for transferring data from one server to a client. The difference between HTTP and most other Internet protocols is that, while typical protocols support multiple requests per connection, only supports HTTP. This means that the HTTP client connects to the server to recover a single file and then disconnects.
HTML also allows integration into an HTML document images and other multimedia objects, these being stored in the web server. Therefore over HTTP can transmit these files.
The web browser sends a single request to the server. The web server determines which file is requested and returned as response data from that file. The browser interprets the response and represents pantalla.La content in the requested information is the location of the file, or other resource required by the user, and information on your browser. The response includes information and other information requested resource. The request is usually plain, the answer may be plain text with some formatting or binary data partially (as in the case of images).
Structure of a Website.
A website is a collection of HTML pages and other media files that contain all the content that the user can see at a particular web server. These files are stored on the web server and can include a complex directory hierarchy. Web site been comprised of the directory hierarchy.
Java Platform, Enterprise Edition or Java EE (formerly known as Java 2 Platform, Enterprise Edition or J2EE up to version 1.4) is a software platform of the Java platform to develop and run software applications in Java programming language architecture distributed N levels, based largely on modular software components running on an application server. The Java EE platform is defined by a specification.
Java Platform, Enterprise Edition 5 (Java EE 5).
a software platform of the Java platform to develop and run software applications in Java programming language with n-tier distributed architecture, based largely on modular software components running on an application server. The Java EE platform is defined by a specification.
WEB SITES AND APPLICATIONS.
A website is a collection of static files, HTML pages, graphics and other various files. A web application is a web site with dynamic functionality on the server. A web application program running on the server, for example:
A browser requests a form to the server.
The server responds by sending the HTML form to the browser in the HTTP request stream.
Then, the browser sends another request to the server with HTML form data.
The server passes the request and data to a program which responds by returning the data to the browser.
CGI Program Execution.
In the early days of HTML, the designers created a mechanism enabling a user to invoke a Web server program. This mechanism is called Common Gateway Interface (CGI), so when a website includes procedures CGI, this is called Web Application.
Normally, the browser must send the data to the server CGI program. The CGI specification determines how they are packaged and sent to the server in the HTTP request. These data are entered in the web browser using an HTML form.
ADVANTAGES AND DISADVANTAGES OF THE PROGRAM CGI.
CGI programs have the following advantages:
Programs can be created in different languages, although Perl is often used.
A CGI program does not produce defective system failure in the Web server.
The programs are easy to reference for a web designer. Once the script created the designer can reference it in a line of a web page.
CGI programs have the following disadvantages:
The response time of CGI programs is high, and running on its own operating system shell. Whereas creating a Shell operating system is a very heavy activity for the operating system.
CGI capable languages are not always safe, or are object oriented.
The CGI script must generate a HTML response, so the CGI code mixed with HTML. So do not adequately separate the business logic and presentation.
The servlet is the advance over the traditional CGI programs. A Java servlet is a java program as a CGI program, running on the server and can perform tasks similar to those performed by a CGI program, but the execution architecture is different.
As in the case of CGI scripts, you can create servlet able to recognize HTTP requests, dynamically generate the response (by consulting the database to satisfy the request) and then send the browser a response containing a document or page HTML.
ADVANTAGES AND DISADVANTAGES OF servlet.
The Servlet has the following advantages:
Each application is running on a different thread, which servlet requests are processed much faster than traditional CGI processing.
The servlet are solid and are oriented to object.
The servlet can only be written in Java, which facilitates creation.
The servlet is platform independent since they are created in java.
The servlet presents the following drawbacks:
The servlet typically contain business logic and presentation logic.
The 3-tier architecture (also called model or pattern) has a user interface client that runs on a user machine that communicates with business logic software on a server, which in turn communicates with the software responsible storage of long-term information on the computers database.
TYPES OF VISUAL COMPONENTS.
There are four types of visual components.
Presentation of data: includes all data presented on a screen visible (graphics, spreadsheets, lists, etc).
Data Forms: are the data entry forms.
Navigational aids: such views include navigation menus, hyperlinks, site maps, etc.
Information screens or pop-ups: This rate includes welcome text views, instructions, help screens, error messages, information boxes, etc.
Hypertext Transfer Protocol (HTTP).
In any communication protocol the client must send a request and the server must transmit a significant response. In HTTP request is a resource specified by a URL, if the URL specifies a static document, the response includes the text of this document. We can consider the request and response surround the URL (but the form data) and the response text. The following figure illustrates the client-server architecture.
You can use different methods to make an HTTP request, as shown below.
OPTIONS Request communications options available in the chain of request / response.
GET requests the retrieval of information specified by the URL of the application.
HEAD Identical to GET, except that it returns a message body, but only the headers.
POST requests the server to accept the authority contained in the HTTP message body.
PUT requests to the server that stores the entity contained in the HTTP message body.
DELETE requests the server to delete the resource specified by the request URI.
TRACESolicita the server to invoke an application-layer loop the request message.
CONNECTReservado for use with a proxy that it can become Tunnel.
HTTP GET method.
The most common method is the HTTP GET request. GET method is used whenever the user clicks a hyperlink in the HTML page you are viewing. Also used the GET method when the user enters a URL in the address field. While processing a Web page the browser also sends GET requests for images, applets, files, style sheets and other related media.
HTTP request headers.
ACCEPTLos MIME types that can receive the customer.
HOSTEL Internet host and port number of the requested resource
REFER direction from which the request URL.
USER-AGENTInformación the client that originated the request.
HTTP response header.
CONTENT-TYPE A MIME type as text / html which classifies the data type of the response.
CONTENT-LENGTH The length in bytes of the response burden
SERVER A string information about a server that has responded to this request.
CACHE-CONTROL A directive to the Web browser indicating where to cache the contents of the response.
+ WEB container architecture.
The Java servlet are components that must exist in a web container. The Web container is created on the Java SE platform and deploy the servlet API and all the services needed to process HTTP requests (and other TCP / IP).
The web container activates the servlet that matches the request URL by calling the service method in an instance of the servlet class. In particular, activation of the service method for a particular HTTP request is handled in a separate thread within the process of web container.
This service is invoked to transmit web pages and you will normally use the links.
It is an innovation on the former, which allows us to access servers (usually commercial) that we offer the use of enciptación techniques for protecting data exchanges with third parties.
Allows you to transmit files from anonymous ftp servers. If you do not ask for a file but a directory, usually the browser is responsible for the content of the show so we can choose it easily. Using the @ private servers can access.
To send a message. For example, the URL mailto: email@example.com send me a message to me.
To access the discussion forums (sometimes mistranslated as newsgroups). It indicates the server and the group. For example news: / / news.ibernet.es / es.comp.demos connect us with the forum es.comp.demos in the national server of Telefonica.
It is usually implemented by browsers, which often invoke an external program. Allows us to connect with other computers and enter them as if our computer was a terminal equipment.
The address of the machine can be either a series of four numbers between 0 and 255 (18.104.22.168) or something more easy to remember as a series of words separated by dots (www.programacion.net). The port is usually not indicated, since a default service.
The route is a series of directories separated by the symbol /, which is used in UNIX (the operating system most widely used in Internet servers).
There is another URL format. When we access a file located on the same machine as the website we are creating we can use this format:
The structure of an HTML document can be summarized as follows:
<TITLE> Page title </ TITLE>
things that affect the page but not its contents
Typically the most appropriate place to put those items on the page that do not alter the content of it, but if the form submission and behavior. That's why the place is highly recommended to place scripts and stylesheets, as the following chapters.
One of the biggest advantages of the site, it is extremely interactive. Users of a page need only write to the author of it to tell anything from it. However, if we want to tell us just a few concrete things (responding to a question, select from several options, etc. ..) should use Form
A scripting language is a small programming language whose code is inserted into the HTML document. This code runs on the user's browser when the page loads or when something special happens such as the click on a link.
These languages allow dynamically vary the content of the document, modify the normal behavior of your browser, validate forms, making small visual tricks, etc ... However, it should be noted that run on the user's browser and not the machine where they are housed, so that they can not do things like manage databases. This makes the counters (for example) to be carried out differently, using CGI programs.