Contents
JSP overview
JavaServer Pages JavaServer Pages (JSP) is one solution to providing dynamic Web content. The days of displaying the same old HTML page to all customers, or to the same customer, who has visited the site several times, is rapidly becoming a thing of the past.
Today, Web pages need to display different content customized according to user input or relevant events. Customers want and expect some sort of personalization from sites. A return customer does not want to be forced to reenter the same information when revisiting the site.
Also, a Web page displaying data relevant to your inputs may need to differ from pages displayed for other users. Imagine an online banking site where you enter your password and see not only information on your accounts, but information for other bank customers as well!
Sites that change based on relevant events also provide a good example of dynamic content. Sites with stock market quotes or weather information need to be refreshed at regular intervals to be useful. News sites must also refresh content to stay on top of what s happening in the world.
Stores that have online catalogs that often change inventory and prices should not contain static content. Today s Internet-related technologies, such as JavaServer Pages, give the Web application developer the means to create pages with dynamic content. JSP combines static text with special JSP tags.
The static text represents invariant parts of the Web page, typically but not necessarily HTML. Note that JSP pages mostly use HTML and XML for the static, template portion. Rather than constantly writing HTML or XML, I ve taken the liberty of writing HTML in this chapter and trusting you to know if HTML or XML or HTML applies.
The JSP tags represent parts of the page that can change depending on the factors the page designer deems appropriate. The basic mechanics are that the static text and the JSP tags are eventually sent to a Java-enabled server that generates HTML from both the static part and the JSP tag.
Once done, the server sends the generated HTML back to the browser for display and continued user interaction. This approach of mixing static text with tags is not unique to JSP.
Indeed, several competing technologies employ this approach. However, JSP enables you to leverage the full power of the Java programming language to make your pages very flexible.
For the JSP hosting visit our Java hosting offer.