Summary

Today, you have seen how servlets can be employed in a Web application to add dynamic content to HTML pages. You learned that servlets have no client interface, and the servlet container controls its lifecycle. Because HTTP is a stateless protocol, servlets have to use external means to retain information between page accesses. Cookies are one method, but when cookies cannot be used, a servlet can use hidden fields or URL rewriting. You have also seen that with event listening and using servlet filters, you can further extend the functionality and reusability of your servlet Web applications.

Servlets generate HTML from within Java code. This works well when the amount of HTML is relatively small, but the coding can become onerous if large amounts of HTML have to be produced. Tomorrow, you will look at another type of servlet called a Java Server Page (JSP). With JSPs, the opposite approach is taken. Here, the servlet Java code is imbedded in the HTML page, avoiding the need to have multiple out.println() statements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.72.212