110 likes | 229 Vues
This article explores the necessity for server-side scripting in web development, specifically focusing on Active Server Pages (ASP) and JavaServer Pages (JSP). It discusses the limitations of static HTML pages and how dynamic content can be implemented through server-side languages. The similarities and differences between ASP and JSP are examined in terms of programming capabilities, database functionalities, and output generation. Resources for further learning and examples of code for both ASP and JSP are included to enhance understanding.
E N D
The need for server pages HTML Need for Dynamic Content Server pages • Hyper-text Markup Language. • Designed to implement the layout of a webpage. • Stateless nature of pure HTML pages. • Example • Led to development of scripting languages • Client-side scripting vs. Server-side scripting • Non-static • Complement HTML to present dynamic data. • Example languages: ASP, JSP Last Updated: November 9, 2014
Similarities Between ASP and JSP • Run on a server as opposed to running on a client • Require good programming skills and logical thought • Provide full SQL database functionality • No difference in the output • Examples: A page in ASP………A page in JSP
Code for the ASP example <html> <head> <title>Hello World</title> </head> <body> <%response.write "<h1>Hello World</h1>"%> </body> </html>
Output of a JSP page code
Code for the JSP example <html> <head> <title>Hello World</title> </head> <body> <h1> <% out.println("Hello World"); %> </h1> </body> </html>
Differences • Functionality of languages: • JScript, VBScript for ASP vs. Java for JSP • JSP-robust exception handling • Interpreted vs. translated • Programming logic vs. page design in JSP • Greater learning curve for JSP vs. ASP • JSP- Open standard vs. ASP- Microsoft tied • Cross-platform reusability • Tag customization
A word of caution • Objectivity is lost on diehard fans of either languages • With advances in both languages it’s a constant struggle to determine which has a upper hand • ASP .NET is the new variation of ASP in direct competition with JSP • Difficult to determine which would be ideal for a given project
Resource Links on the Web • http://www.w3schools.com • http://www.jsptut.com
An Example HTML Page code
Code for the HTML Example <html> <head> <title>Hello World</title> </head> <body> <h1>Hello World</h1> </body> </html>