JavaServer Page

December 31, 2006

CHAPTER 1 The big picture What is a

Filed under: JSP Tag Libraries — webmaster @ 12:15 pm

CHAPTER 1 The big picture What is a tag-based solution like? We ll defer specifics about custom JSP tags until chapter 3, but will mention some of the basics of this extension mechanism to afford a glimpse at its benefits. Developing with tags resembles the server pages development model with one crucial difference the development language is not a script, but is rather based on sequences of characters (usually starting with a < and ending with a > ) known as tags. A tagged server page includes the page s content (usually HTML) plus tags that can be used to add logic to the content. When the user asks for a tagged page, the server interprets the page, finds all the logic tags, and executes them along with the page content. To see an example of tag-based programming, let s look at a ColdFusion fragment (listing 1.3) which mimics the ASP code in listing 1.1. Listing 1.3 Sample ColdFusion fragment that generates dynamic content You asked for the server located on your local machine. You asked for the server #CGI.SERVER_NAME# As you can see, instead of using VBScript (the language of choice in listing 1.1) we are now using special ColdFusion tags (prefixed with CF). Using these tags, the developer can easily implement simple logic. ColdFusion started up with a limited tag set geared toward database manipulation and presentation. They soon added tags to perform programming tasks, including iteration over arrays with tags such as CFLOOP; catching exceptions with tags such as and ; and performing various utility operations with tags such as , and . 1.4.1 Benefits of a tag-based approach How is using tags any different from embedding script in a server page? After all, this may look like yet another case of server pages with just a different scripting syntax (tag-based, instead of the more common programming syntax). In a way, this is correct; however, tag-based technologies offer advantages. Using tags is much more comfortable for many HTML developers who are very familiar with the use of tags

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting