Download The ASP model - E

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

URL redirection wikipedia , lookup

Transcript
NEHRU ARTS AND SCIENCE COLLEGE
DEPARTMENT OF COMPTUER APPLICATIONS
SUBJECT: Web Technologies
_____________________________________________________________________________
UNIT-III: Introduction to Web Technology: Web pages – Tiers – Concept of a Tier –
Comparison of Microsoft and Java Technologies – Web Pages – Static Web Pages – Plug-ins –
Frames – Forms. Dynamic Web Pages: Need – Magic of Dynamic Web Pages – Overview of
Dynamic Web Page Technologies – Overview of DHTML – Common Gateway Interface – ASP
– ASP Technology – ASP Example – Modern Trends in ASP – Java and JVM – Java Servlets –
Java Server Pages.
_____________________________________________________________________________
PART A
1) What is dynamic web page?
The dynamic web page is a kind of web page that has been prepared with fresh
information (content and/or layout), for each individual viewing.
2) List two types of websites?
 Client-side scripting and content creation
 Server-side scripting and content creation
3) What is java servlet?
A servlet is a Java programming language class used to extend the capabilities of servers that
host applications accessed via a request-response programming model.
PART B
1) Explain 2 types of dynamic websites?
Two types of dynamic web sites
Client-side scripting and content creation
 Using client-side scripting to change interface behaviors within a specific web page,
in response to mouse or keyboard actions or at specified timing events.
 In this case the dynamic behavior occurs within the presentation.
 Such web pages use presentation technology called rich interfaced pages. Client-side
scripting languages like JavaScript or ActionScript, used for Dynamic HTML
(DHTML) and Flash technologies respectively, are frequently used to orchestrate
media types (sound, animations, changing text, etc.) of the presentation.
 The scripting also allows use of remote scripting, a technique by which the DHTML
page requests additional information from a server, using a hidden Frame,
XMLHttpRequests, or a Web service.
 The Client-side content is generated on the user's computer. The web browser
retrieves a page from the server, then processes the code embedded in the page (often
written in JavaScript) and displays the retrieved page's content to the user.
 The innerHTML property (or write command) can illustrate the client-side dynamic
page generation: two distinct pages, A and B, can be regenerated as
document.innerHTML = A and document.innerHTML = B; or "on load dynamic" by
document.write(A) and document.write(B).
 There are also some utilities and frameworks for converting HTML files into
JavaScript files. For example webJS[1] uses innerHTML property for rendering pages
from converted HTML on client-side.
 The first "widespread used" version of JavaScript was 1996 (with Netscape 3 an
ECMAscript standard).
Server-side scripting and content creation
 A program running on the web server (server-side scripting) is used to change the
web content on various web pages, or to adjust the sequence of or reload of the
web pages.
 ‘Server responses may be determined by such conditions as data in a posted
HTML form, parameters in the URL, the type of browser being used, the passage
of time, or a database or server state.
 Such web pages are often created with the help of server-side languages such as
ASP, ColdFusion, Perl, PHP, and other languages.
 These server-side languages often use the Common Gateway Interface (CGI) to
produce dynamic web pages.
 Two notable exceptions are ASP.NET and JSP, which reuse CGI concepts in their
APIs but actually dispatch all web requests into a shared virtual machine.
 Server-side dynamic pages can also use the first kind of dynamic content on the
client side.
 While VM-based server-side languages and CGI would be preferred for new
development, some web-servers also support Server Side Includes (typically for a
file extension such as .shtml), and Jhtml was a Java server-side technology
developed before JSP.

2) Explain Java Servlet:
 A servlet is a Java programming language class used to extend the capabilities of
servers that host applications accessed via a request-response programming
model. Although servlets can respond to any type of request, they are commonly





used to extend the applications hosted by Web servers. Thus, it can be thought of
as a Java Applet that runs on a server instead of a browser.[1]
A Servlet is a Java class in Java EE that conforms to the Java Servlet API, a
protocol by which a Java class may respond to requests. They are not tied to a
specific client-server protocol, but are most often used with the HTTP protocol.
Therefore, the word "Servlet" is often used in the meaning of "HTTP Servlet".[2]
Thus, a software developer may use a servlet to add dynamic content to a Web
server using the Java platform. The generated content is commonly HTML, but
may be other data such as XML. Servlets are the Java counterpart to non-Java
dynamic Web content technologies such as CGI and ASP.NET. Servlets can
maintain state in session variables across many server transactions by using HTTP
cookies, or URL rewriting.
To deploy and run a Servlet, a Web container must be used. A Web container is
essentially the component of a Web server that interacts with the servlets. The
Web container is responsible for managing the lifecycle of servlets, mapping a
URL to a particular servlet and ensuring that the URL requester has the correct
access rights.
The servlet API, contained in the Java package hierarchy javax.servlet, defines the
expected interactions of the Web container and a servlet.[2]
A Servlet is an object that receives a request and generates a response based on
that request. The basic servlet package defines Java objects to represent servlet
requests and responses, as well as objects to reflect the servlet's configuration
parameters and execution environment. The package javax.servlet.http defines
HTTP-specific subclasses of the generic servlet elements, including session
management objects that track multiple requests and responses between the Web
server and a client. Servlets may be packaged in a WAR file as a Web application.
Servlets can be generated automatically from JavaServer Pages (JSP) by the
JavaServer Pages compiler. The difference between Servlets and JSP is that
Servlets typically embed HTML inside Java code, while JSPs embed Java code in
HTML. While the direct usage of Servlets to generate HTML (as shown in the
example below) is relatively rare nowadays, the higher level MVC web
framework in Java EE (JSF) still explicitly uses the Servlet technology for the low
level request/response handling via the FacesServlet. A somewhat older usage is
to use servlets in conjunction with JSPs in a pattern called "Model 2", which is a
flavor of the model-view-controller pattern.
3) Explain about Java Servlet?
 A servlet is a Java programming language class used to extend the capabilities of
servers that host applications accessed via a request-response programming
model. Although servlets can respond to any type of request, they are commonly
used to extend the applications hosted by Web servers. Thus, it can be thought of
as a Java Applet that runs on a server instead of a browser.
 A Servlet is a Java class in Java EE that conforms to the Java Servlet API, a
protocol by which a Java class may respond to requests. They are not tied to a
specific client-server protocol, but are most often used with the HTTP protocol.
 Therefore, the word "Servlet" is often used in the meaning of "HTTP Servlet". [2]
Thus, a software developer may use a servlet to add dynamic content to a Web
server using the Java platform.
 The generated content is commonly HTML, but may be other data such as XML.
Servlets are the Java counterpart to non-Java dynamic Web content technologies
such as CGI and ASP.NET. Servlets can maintain state in session variables across
many server transactions by using HTTP cookies, or URL rewriting.
 To deploy and run a Servlet, a Web container must be used. A Web container is
essentially the component of a Web server that interacts with the servlets. The
Web container is responsible for managing the lifecycle of servlets, mapping a
URL to a particular servlet and ensuring that the URL requester has the correct
access rights.
 The servlet API, contained in the Java package hierarchy javax.servlet, defines the
expected interactions of the Web container and a servlet.[2]
 A Servlet is an object that receives a request and generates a response based on
that request. The basic servlet package defines Java objects to represent servlet
requests and responses, as well as objects to reflect the servlet's configuration
parameters and execution environment. The package javax.servlet.http defines
HTTP-specific subclasses of the generic servlet elements, including session
management objects that track multiple requests and responses between the Web
server and a client. Servlets may be packaged in a WAR file as a Web application.
 Servlets can be generated automatically from JavaServer Pages (JSP) by the
JavaServer Pages compiler. The difference between Servlets and JSP is that
Servlets typically embed HTML inside Java code, while JSPs embed Java code in
HTML. While the direct usage of Servlets to generate HTML (as shown in the
example below) is relatively rare nowadays, the higher level MVC web
framework in Java EE (JSF) still explicitly uses the Servlet technology for the low
level request/response handling via the FacesServlet. A somewhat older usage is
to use servlets in conjunction with JSPs in a pattern called "Model 2", which is a
flavor of the model-view-controller pattern.
PART C:
1) Explain about Dynamic web pages?
A dynamic web page is a kind of web page that has been prepared with fresh
information (content and/or layout), for each individual viewing. It is not static because it
changes with the time (e.g. news content), the user (e.g. preferences in a login session),
the user interaction (e.g. web page game), the context (e.g. parametric customization), or
any combination thereof.
Properties associated with dynamic web pages
 Classical hypertext navigation occurs among "static" documents, and, for web users,
this experience is reproduced using static web pages, meaning that a page retrieved by
different users at different times is always the same, in the same form.
 However, a web page can also provide a live user experience. Content (text, images,
form fields, etc.) on a web page can change in response to different contexts or
conditions. In dynamic sites, page content and page layout are created separately.
 The content is retrieved from a database and is placed on a web page only when
needed or asked.
 This allows for quicker page loading, and it allows just about anyone with limited
web design experience to update their own website via an administrative tool.
 This set-up is ideal for those who wish to make frequent changes to their websites
including text and image updates, e.g. e-commerce.
Two types of dynamic web sites
Client-side scripting and content creation
o Using client-side scripting to change interface behaviors within a specific web
page, in response to mouse or keyboard actions or at specified timing events.
o In this case the dynamic behavior occurs within the presentation.
o Such web pages use presentation technology called rich interfaced pages.
Client-side scripting languages like JavaScript or ActionScript, used for
Dynamic HTML (DHTML) and Flash technologies respectively, are
frequently used to orchestrate media types (sound, animations, changing text,
etc.) of the presentation.
o The scripting also allows use of remote scripting, a technique by which the
DHTML page requests additional information from a server, using a hidden
Frame, XMLHttpRequests, or a Web service.
o The Client-side content is generated on the user's computer. The web browser
retrieves a page from the server, then processes the code embedded in the
page (often written in JavaScript) and displays the retrieved page's content to
the user.
o The innerHTML property (or write command) can illustrate the client-side
dynamic page generation: two distinct pages, A and B, can be regenerated as
document.innerHTML = A and document.innerHTML = B; or "on load
dynamic" by document.write(A) and document.write(B).
o There are also some utilities and frameworks for converting HTML files into
JavaScript files. For example webJS[1] uses innerHTML property for
rendering pages from converted HTML on client-side.
o The first "widespread used" version of JavaScript was 1996 (with Netscape 3
an ECMAscript standard).
Server-side scripting and content creation
a. A program running on the web server (server-side scripting) is used to change the
web content on various web pages, or to adjust the sequence of or reload of the
web pages.
b. ‘Server responses may be determined by such conditions as data in a posted
HTML form, parameters in the URL, the type of browser being used, the passage
of time, or a database or server state.
c. Such web pages are often created with the help of server-side languages such as
ASP, ColdFusion, Perl, PHP, and other languages.
d. These server-side languages often use the Common Gateway Interface (CGI) to
produce dynamic web pages.
e. Two notable exceptions are ASP.NET and JSP, which reuse CGI concepts in their
APIs but actually dispatch all web requests into a shared virtual machine.
f. Server-side dynamic pages can also use the first kind of dynamic content on the
client side.
g. While VM-based server-side languages and CGI would be preferred for new
development, some web-servers also support Server Side Includes (typically for a
file extension such as .shtml), and Jhtml was a Java server-side.
2) Brief description about the overview of DHTML?
Dynamic HTML is not really a new specification of HTML, but rather a new way of
looking at and controlling the standard HTML codes and commands.
When thinking of dynamic HTML, you need to remember the qualities of standard
HTML, especially that once a page is loaded from the server, it will not change until
another request comes to the server. Dynamic HTML give you more control over the
HTML elements and allows them to change at any time, without returning to the Web
server.
There are four parts to DHTML:
a.
b.
c.
d.
Document Object Model (DOM)
Scripts
Cascading Style Sheets (CSS)
XHTML
DOM
The DOM is what allows you to access any part of your Web page to change it with
DHTML. Every part of a Web page is specified by the DOM and using its consistent
naming conventions you can access them and change their properties.
Scripts
Scripts written in either JavaScript or ActiveX are the two most common scripting
languages used to activate DHTML. You use a scripting language to control the objects
specified in the DOM.
Cascading Style Sheets
CSS is used in DHTML to control the look and feel of the Web page. Style sheets define
the colors and fonts of text, the background colors and images, and the placement of
objects on the page. Using scripting and the DOM, you can change the style of various
elements.
XHTML
XHTML or HTML 4.x is used to create the page itself and build the elements for the CSS
and the DOM to work on. There is nothing special about XHTML for DHTML - but
having valid XHTML is even more important, as there are more things working from it
than just the browser.
Features of DHTML
There are four primary features of DHTML:
1.
2.
3.
4.
Changing the tags and properties
Real-time positioning
Dynamic fonts (Netscape Communicator)
Data binding (Internet Explorer)
Changing the tags and properties
This is one of the most common uses of DHTML. It allows you to change the qualities of an
HTML tag depending on an event outside of the browser (such as a mouse click, time, or
date, and so on). You can use this to preload information onto a page, and not display it
unless the reader clicks on a specific link.
Real-time postioning
When most people think of DHTML this is what they expect. Objects, images, and text
moving around the Web page. This can allow you to play interactive games with your
readers or animate portions of your screen.
Dynamic Fonts
This is a Netscape only feature. Netscape developed this to get around the problem
designers had with not knowing what fonts would be on a reader's system. With dynamic
fonts, the fonts are encoded and downloaded with the page, so that the page always looks
how the designer intended it to.
Data binding
This is an IE only feature. Microsoft developed this to allow easier access to databases from
Web sites. It is very similar to using a CGI to access a database, but uses an ActiveX control
to function. This feature is very advanced and difficult to use for the beginning DHTML
writer.
3) Explain the ASP briefly?
Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was
Microsoft's first server-side script-engine for dynamically-generated Web pages. Initially
released as an add-on to Internet Information Services (IIS) via the Windows NT 4.0
Option Pack (ca. 1998), it was subsequently included as a free component of Windows
Server (since the initial release of Windows 2000 Server). ASP.NET has superseded
ASP.
ASP 2.0 provided six built-in objects: Application, ASPError, Request, Response,
Server, and Session. Session, for example, represents a cookie-based session that
maintains the state of variables from page to page. The Active Scripting engine's support
of the Component Object Model (COM) enables ASP Websites to access functionality in
compiled libraries such as DLLs.
ASP TECHNOLOGY
There are several forms of ASP business. These are:
 A specialist or functional ASP delivers a single application, such as credit card payment
processing or timesheet services;
 A vertical market ASP delivers a solution package for a specific customer type, such as a
dental practice;
 An enterprise ASP delivers broad spectrum solutions;
 A local ASP delivers small business services within a limited area.
Some analysts identify a volume ASP as a fifth type. This is basically a specialist ASP
that offers a low cost packaged solution via their own website. PayPal was an instance of
this type, and their volume was one way to lower the unit cost of each transaction.
In addition to these types, some large multi-line companies (such as HP and IBM), use
ASP concepts as a particular business model that supports some specific customers.
The ASP model
The application software resides on the vendor's system and is accessed by users through
a web browser using HTML or by special purpose client software provided by the
vendor. Custom client software can also interface to these systems through XML APIs.
These APIs can also be used where integration with in-house systems is required. ASPs
may or may not use multi-tenancy in the deployment of software to clients; some ASPs
offer an instance or license to each customer (for example using Virtualization), some
deploy in a single instance multi-tenant access mode, now more frequently referred to as
"SaaS".
Common features associated with ASPs include:




ASP fully owns and operates the software application(s) - ALJO-IN
ASP owns, operates and maintains the servers that support the software
ASP makes information available to customers via the Internet or a "thin client"
ASP bills on a "per-use" basis or on a monthly/annual fee
The advantages to this approach include:









Software integration issues are eliminated from the client site
Software costs for the application are spread over a number of clients
Vendors can build more application experience than the in-house staff
Key software systems are kept up to date, available, and managed for performance by
experts
Improved reliability, availability, scalability and security of internal IT systems
A provider's service level agreement guarantees a certain level of service
Access to product and technology experts dedicated to available products
Reduction of internal IT costs to a predictable monthly fee
Redeploying IT staff and tools to focus on strategic technology projects that impact the
enterprise's bottom line
Some inherent disadvantages include:

The client must generally accept the application as provided since ASPs can only afford a
customized solution for the largest clients
 The client may rely on the provider to provide a critical business function, thus limiting
their control of that function and instead relying on the provider
 Changes in the ASP market may result in changes in the type or level of service available
to clients
 Integration with the client's non-ASP systems may be problematic
Evaluating an Application Service Provider security when moving to an ASP infrastructure
can come at a high cost, as such a firm must assess the level of risk associated with the ASP
itself. Failure to properly account for such risk can lead to:





Loss of control of corporate data
Loss of control of corporate image
Insufficient ASP security to counter risks
Exposure of corporate data to other ASP customers
Compromise of corporate data
Some other risks include failure to account for the financial future of the ASP in general, i.e.
how stable a company is and if it has the resources to continue business into the foreseeable
future. For these reasons Cisco Systems has developed a comprehensive evaluation
guideline. This guideline includes evaluating the scope of the ASP's service, the security of
the program and the ASP's maturity with regard to security awareness. Finally the guidelines
indicate the importance of performing audits on the ASP with respect to:
 Port/Network service
 Application vulnerability
 ASP Personnel
Physical visits to the ASP to assess the formality of the organization will provide invaluable
insight into the awareness of the firm.
ASP Examples
<html>
<body>
Today's date is: <%response.write(date())%>.
<br />
The server's local time is: <%response.write(time())%>.
</body>
</html>
OUTPUT:
Today's date is: 11/5/2011.
The server's local time is: 4:32:11 AM.