Tuesday, January 1st, 2008
EJB & JSP: Java On The Edge, Unlimited Edition by Lou Marco ISBN: 0764548026 Your Guide to Cutting-Edge J2EE Programming Techniques. Chapter 4: The Elements of a JSP Page In the previous chapter, you explored some simple JSP pages. In this chapter, you learn about all the elements of a JSP page and you see coding examples using these elements. After you read this chapter, you ll have an understanding of how to code all the JSP elements mentioned. Coding Static Page Content in JSP Pages You ve read that a JSP page is static text, often in the form of HTML or XML tags, combined with programming elements responsible for generating dynamic content. Often, a sizeable chunk of your JSP page is static. To use such static text in your JSP, you code the static text as is into the page, using whatever syntax rules apply to the class of text. If your static text is HTML, for example, you code the HTML as you always would, using the known and familiar syntax rules for proper HTML formation. The static text you code in the JSP page ends up as Java println statements in the generated servlet. The generated servlet eventually passes the text back to the client, where the browser displays the text together with generated dynamic page content. Typing text in a JSP page is a plus compared with writing println statements to generate the text in a servlet. Before you leave the subject of including invariant text in your JSP pages, know that HTML or XML comments will pass through unchanged like any other static text and display in the browser, but JSP comments will not. The remainder of this chapter describes the programmable elements of a JSP those elements responsible for generating dynamic content.
Do you want something as professional as you are? Well, we are, but our plans are even better, please check Web Hosting SSH and look why we are the best.