CHAPTER 1 The big picture Listing 1.1 Sample
CHAPTER 1 The big picture Listing 1.1 Sample ASP fragment that generates dynamic content < % @Language = "VBScript" %>
< % If Request.ServerVariables("SERVER_NAME") = "localhost" then %> You asked for the server located on your local machine. < % else %> You asked for the server < %= Request.ServerVariables("SERVER_NAME") %> < % end if %> This fragment obviously contains standard HTML, with the exception of special text found between the < % and %> characters. That special text is the script the server executes when this page is requested. In this case (and in most ASPs), the script is written in Microsoft VBScript language. This particular ASP fragment creates dynamic content which is affected by the value of a server variable, SERVER_NAME. You should be able to make out the conditional logic in this fragment, which dictates that if the value pointed to by SERVER_NAME is the string localhost , a message is returned to the user stating they are on their local machine. Otherwise, a different message is returned, including the value of the variable SERVER_NAME. This logic is pretty easy to identify, even if you ve never before seen ASP. The scripting languages for server page technologies have been designed to keep the entry barrier low, so that both beginning programmers and ambitious HTML developers can readily grasp the syntax. To further simplify the generation of dynamic content, server pages technologies provide a means of extending the core scripting syntax with objects that enable low- level functionality, such as database access and email support. Most server pages environments ship with built-in support for popular databases, which greatly simplifies the task of generating data-driven web applications. This simplicity, coupled with the fact that the server does not have to repeatedly open (and initialize) new processes, makes server pages technologies the foundation of many web applications. Yet, as you may imagine, this simplicity comes at a price. Server pages drawbacks A number of issues must be admitted in any complete discussion of server pages. To begin, there is the matter of speed. Server pages-based applications are slow relative to the server API counterpart. Yes, the programmer s productivity is enhanced, but the performance decline makes it obvious there is room for improvement.Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services