1 / 14

MSIS 6 55 Advanced Business Applications Programming

Week 15 Servlets. MSIS 6 55 Advanced Business Applications Programming. 15 . 1. Servlet Overview and Architecture. Servlet Small portion of the content is static text or markup Do not produce content Perform a task on behalf of the client JavaServer Pages Extension of servlet technology

shae
Download Presentation

MSIS 6 55 Advanced Business Applications Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week 15 Servlets MSIS 655Advanced Business Applications Programming 15.1

  2. Servlet Overview and Architecture • Servlet • Small portion of the content is static text or markup • Do not produce content • Perform a task on behalf of the client • JavaServer Pages • Extension of servlet technology • Most of the content is static text or markup • Small portion of the content is generated dynamically • Servlet container (servlet engine) • Server that executes a servlet

  3. What are Java Servlets? • Servlets are Java technology's answer to CGI programming. They are programs that run on a Web server and build Web pages. Building Web pages on the fly is useful (and commonly done) for a number of reasons: • The Web page is based on data submitted by the user. • The data changes frequently. • The Web page uses information from corporate databases or other such sources.

  4. Fig. 26.1 | Servlet architecture.

  5. Servlets and JavaServer Pages (JSP) • Request-response model • Packages javax.servlet javax.servlet.http javax.servlet.jsp javax.servlet.tagext • Common implementation of request-response model • Web browsers and Web servers • Form the Web components of J2EE

  6. JavaServer Pages • JavaServer Pages • Extension of Servlet technology • Separate the presentation from the business logic • Simplify the delivery of dynamic Web content • Reuse existing Java components • JavaBean • Custom-tag libraries • Encapsulate complex functionality • Classes and interfaces specific to JSP • Package javax.servlet.jsp • Package javax.servlet.jsp.tagext

  7. JavaServer Pages Overview • JSPs • Look like standard XHTML or XML • Normally include XHTML or XML markup • Known as fixed-template data • Key components • Directives • Actions • Scripting elements • Tag libraries

  8. First JSP Example • Simple JSP example (Fig. 27.1) • Demonstrates • Fixed-template data (XHTML markup) • Creating a Java object (java.util.Date) • Automatic conversion of JSP expression to a String • meta element to refresh Web page at specified interval

  9. Scripting Components • JSP scripting components • Scriptlets (delimited by <% and %>) • Comments • JSP comments (delimited by <%-- and --%>) • XHTML comments (delimited by <!-- and -->) • Java’s comments (delimited by // and /* and */) • Expressions (delimited by <%= and %>) • Declarations (delimited by <%! and %>) • Escape sequences

More Related