InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.1a: JSP access models

4.2.2.1a: JSP access models

JSP files can be accessed in two ways:

  • The browser sends a request for a JSP file.

    The JSP file accesses beans or other components that generate dynamic content that is sent to the browser, as shown:

    Request for a JSP file
    Graphic: Request for a JSP file

    When the Web server receives a request for a JSP file, the server sends the request to the application server. The application server parses the JSP file and generates Java source, which is compiled and executed as a servlet.

  • The request is sent to a servlet that generates dynamic content and calls a JSP file to send the content to the browser, as shown:

    Request for a servlet
    Graphic: Request for a servlet

    This access model facilitates separating content generation from content display.

    The application server supplies a set of methods in the HttpServiceRequest object and the HttpServiceResponse object. These methods allow an invoked servlet to place an object (usually a bean) into a request object and pass that request to another page (usually a JSP file) for display. The invoked page retrieves the bean from the request object and generates the client-side HTML.

Go to previous article: JavaServer Pages (JSP) lifecycle Go to next article: JSP support and environment in WebSphere

 

 
Go to previous article: JavaServer Pages (JSP) lifecycle Go to next article: JSP support and environment in WebSphere