13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

18.3 Perspective405<strong>Linux</strong> systemWeb serverServlet classHTTP requestHTMLPCWeb browserFigure 18.1 Servlet diagram• doPost(HttpServletRequest request, HttpServletResp<strong>on</strong>seresp<strong>on</strong>se)We hope that you’ve noticed the similarity between doGet(), doPost(),and the previously menti<strong>on</strong>ed service() method. More <strong>on</strong> that in a minute.18.3PERSPECTIVETo better understand the interacti<strong>on</strong> with servlets, let’s c<strong>on</strong>sider the requeststhat come to a Web server. Web servers serve up Web pages. At first (in theearly days of the Web) that just meant simple flat HTML files, al<strong>on</strong>g with afew image types. A Web browser would send a request to a Web server in theform of a URL, such as http://www.dom.com/file.html, which would besent to the Web server named www at the dom.com domain. It would look upthe file named file.html in its directory and send it back to the browser.That approach worked fine, and still does today. But this <strong>on</strong>ly covers staticWeb pages, <strong>on</strong>es whose c<strong>on</strong>tent doesn’t change. Users want to get at lots moreinformati<strong>on</strong> today, not all of which has been embodied in static Web pages.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!