![]() ![]() Look at the URL Mapping automatically created by eclipse and then press next. This URL Mapping is the relative URI where you can find the servlet. Write the name of the servlet and press next. Right click on the project folder and press New->Servlet 7 New Servlet We are going to create an example servlet to see how this works.Ĭhoose Dynamic Web Project 5 Dynamic Web ProjectĬlick next and then write the name of the project 6 Name The project 5.1 Example servlet 5.1.1 Create the project The servlets are Java classes that are used to serve dynamic web content. You can use Tomcat to serve static content as well. Recent versions of Tomcat have an improved performance to serve static content. Tomcat server is a servlet container, which is designed to serve Java servlets. Tomcat is a server that is meant to run applications that were written in Java. ![]() The browser, in this case Firefox, makes a request to the Apache http server and then the server as a response sends the page we created before. Now open the browser to see the static content. Go to the URI you see the following page. Save the HTML file as example.html and copy the file in the htdocs directory. Copy the file in the Apache HTTP server public directory. Let’s create a simple HTML file to show the static content.Īpache serve documents from the DocumentRoot directory. Open the file nf to see where the DocumentRoot is.Īs we can see the DocumentRoot is on C:\Java\Apache24\htdocs 1 Apache Web Server Request-Response 4.2 Apache HTTP server serving simple HTML file One of the main purposes of the Apache web server is to serve HTML files that are text files formated with the HTML markup language. Other static content could be served as well, like XML, JSON, images, video files, sound files, etc. Static content is meant to use a request/response scheme that is a message exchange pattern. The client makes a request to the server and the server sends a response. PrerequisitesĪpache HTTP server is a web server, which used to serve static content like HTTP pages and serve dynamic content with the help of scripting languages like PHP, PERL, PYTHON, etc.Īpache HTTP server is a general-purpose HTTP server, which supports a number of advanced options like a proxy, load balancing, URL rewriting, virtual hosts, SSL/TLS encryption, CGI content and a huge list of modules that involves everything a web server can do.
0 Comments
Leave a Reply. |