Академический Документы
Профессиональный Документы
Культура Документы
Prepared by:
Bhawana Bothara
[Lecturer CSE Dept. JIET SETG]
Week 3-4
IIS and Appache
Configure IIS Server and appache server
Week 4
ActiveX control
Week 5-6
1. Create an MVC application using JSP Servelets
2. ADO.Net
3. Create Application object and session in JSP
4. File system management in JSP
Week 7-8
1. Create a small web aplication in asp.
2. Create a small web application in php.
Week 8
AJAX Introduction
1. Write a program to change content using ajax.
2. Write a program to read hint from a php file using AJAX.
3. Write a program to change the text using AJAX JQuery.
Week 9
Web Services
1. Create a web service usin SOAP.
Week 10
Cloud computing online IDE
1. Create a basic application in Salesforce.com
2. Create an application that uses database in salesforce.com
What is HTML?
HTML is a markup language for describing web documents (web pages).
HTML stands for Hyper Text Markup Language
A markup language is a set of markup tags
HTML documents are described by HTML tags
Each HTML tag describes different document content
HTML Headings
Headings are defined with the <h1> to <h6> tags.<h1> defines the most important heading. <h6> defines the
least important heading.
HTML Paragraphs
The HTML <p> element defines a paragraph.
HTML Styling
Every HTML element has a default style (background color is white and text color is black).
Changing the default style of an HTML element, can be done with the style attribute.
This example changes the default background color from white to lightgrey:
<body style="background-color:lightgrey">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
HTML Text Formatting Elements
HTML Links
In HTML, links are defined with the <a> tag. The href attribute specifies the destination address .The link text is the
visible part (Visit our HTML tutorial).The target attribute specifies where to open the linked document.
This example will open the linked document in a new browser window or in a new tab:
Example
<a href="http://www.test.com/" target="_blank">Visit test!</a>
HTML Tables
Tables are defined with the <table> tag.
Tables are divided into table rows with the <tr> tag.
Table rows are divided into table data with the <td> tag.
A table row can also be divided into table headings with the <th> tag.
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Assignment 1
1. Write a program which will perform the following tasks:
1. Use of html main tags
2. H1 to h6 tags
3. P , b , I tags
4. Use of br hr
5. Use of hyperlink and image
<html>
<head>
<title>one</title>
</head>
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>
A JavaScript function is a block of JavaScript code, that can be executed when "asked" for.
For example, a function can be executed when an event occurs, like when the user clicks a button.
Function Invocation
The code inside the function will execute when "something" invokes (calls) the function:
Function Return
When JavaScript reaches a return statement, the function will stop executing.
If the function was invoked from a statement, JavaScript will "return" to execute the code after the invoking
statement.
Functions often compute a return value. The return value is "returned" back to the "caller"
External JavaScript
External scripts are practical when the same code is used in many different web pages.
To use an external script, put the name of the script file in the src (source) attribute of the <script> tag:
<script src=”jsfile.js”></script>
JavaScript Variables
VB SCRIPT
You can declare VBScript variables with the Dim, Public or the Private statement.
A Sub procedure:
Sub mysub(argument1,argument2)
some statements
End Sub
A Function procedure:
Function myfunction(argument1,argument2)
some statements
myfunction=some value
End Function
Conditional Statements
Conditional statements are used to perform different actions for different decisions.
Looping Statements
Looping statements are used to run the same block of code a specified number of times.
For Each...Next statement - runs code for each item in a collection or each element of an array
Assignment – 2
<body>
<script>
document.write("Hello, World! (With JavaScript)") ;
</script>
</body>
</html>
2. Write a program to display a alert box.
<html>
<body>
<script>
alert("Hello, World! (As an alert!)") ;
</script>
</body>
</html>
Write a program to that takes input from user and display it.
<html>
<body>
<p>Click the button to demonstrate the prompt box.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
}
</script>
</body>
</html>
<html>
<script>
function addno()
{
var val1 = parseInt(document.getElementById("value1").value);
var val2 = parseInt(document.getElementById("value2").value);
var z = val1+val2;
alert(z);
}
</script>
<body>
value1 = <input type="text" id="value1" name="value1" value="1"/>
value2 = <input type="text" id="value2" name="value2" value="2"/>
<html>
<head>
<script type="text/javascript">
function checknumber()
{
var val1 = parseInt(document.getElementById("value1").value);
if (isNaN(val1))
{
alert("Please Enter a Number");
}
else if (val1 == 0)
{
alert("The number is zero");
}
else if (val1%2==0)
{
alert("The number is odd");
}
else
{
<html>
<head>
<script type="text/javascript">
var n=prompt("Enter a number between 1 and 7");
switch (n)
{
case (n="1"):
document.write("Sunday");
break;
case (n="2"):
document.write("Monday");
break;
case (n="3"):
document.write("Tuesday");
break;
case (n="4"):
document.write("Wednesday");break;
case (n="5"):
document.write("Thursday");
break;
case (n="6"):
document.write("Friday");
break;
case (n="7"):
document.write("Saturday");
break;
default:
document.write("Invalid Weekday");
<html>
<head>
<script>
var testa = [1,2,5,6,9,1];
var arrayLength = testa.length;\
var sum = 0;
for (var i = 0; i < arrayLength; i++) {
sum = sum+testa[i];
}
alert(sum);
</script>
</head>
<body>
test
</body>
</html>
<html>
<head>
<script type="text/javascript">
function sub()
{
if(document.getElementById("t1").value == "")
{
alert("Please enter your name");
return false;
}
else if(document.getElementById("t2").value == "")
{
alert("Please enter a password");
return false;
<p id="demo"></p>
<script>
var d = new Date();
document.getElementById("demo").innerHTML = d.getTime();
</script>
</body>
</html>
Web Servers
A Web server is a program that, using the client/server model and the World Wide Web's Hypertext
Transfer Protocol ( HTTP ), serves the files that form Web pages to Web users (whose computers contain
HTTP clients that forward their requests). Every computer on the Internet that contains a Web site must have
a Web server program. Two leading Web servers are Apache , the most widely-installed Web server, and
Microsoft's Internet Information Server ( IIS ). Other Web servers include Novell's Web Server for users of its
NetWare operating system and IBM's family of Lotus Domino servers, primarily for IBM's OS/390 and AS/400
customers.
Apache
Apache is a freely available Web server that is distributed under an "open source" license. Version 2.0 runs on
most UNIX-based operating systems (such as Linux, Solaris, Digital UNIX, and AIX), on other UNIX/POSIX-
derived systems (such as Rhapsody, BeOS, and BS2000/OSD), on AmigaOS, and on Windows 2000. According
to a Netcraft (www.netcraft.com) Web server survey 60% of all Web sites on the Internet are using Apache
(62% including Apache derivatives), making Apache more widely used than all other Web servers combined.
All-in-One packages
There are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and other
applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer and
Web.Developer. There is nothing wrong with using these packages, although manually installing Apache will
help you learn more about the system and its configuration options.
In Internet Explorer, you may get a warning about downloading the file. Click the yellow information
bar that appears above the Web page in IE, and choose Download File…
In Vista you may see a message warning you that XAMPP may not work when installed in the
C:\Program Files directory. The default installation is in C:\XAMPP so you don’t have to worry about
this problem.
20 Web Devlopment 7CS7
4. Click the Next button.
The installer suggests putting the application on your main drive at C:\XAMPP. You can pretty much
install it anywhere, but with the Vista operating system you may encounter problems if you install it in
C:\Program Files.
6. Click Install.
The installer places all the files onto your system. This process takes a while, since a lot of programs
and files are being installed.
8. Click Yes, to open the XAMPP Control Panel (see screenshot below).
The XAMPP Control Panel lets you start and stop the Apache Web server and MySQL database server.
9. If the buttons to the right of Apache and MySQL say Start, click them to start the Web server and the
MySQL database server.
You probably get a Windows security alert about both MySQL and Apache: Click the Unblock button in
both cases. This action allows the two servers to run, and tells the Windows firewall protection service
that everything is OK.If Apache and MySQL are already running, these buttons say Stop. (Clicking them
turns off the Web server and MySQL.) Whenever you start Apache, PHP automatically starts as well. At
this point, you should have a complete testing server running on your machine. You just need to make
sure it’s working.
10. To do so, launch a Web browser, and, in the Location bar, type http://localhost/.
You encounter a page that lists a bunch of languages; click the language you prefer, and you’re taken
to a kind of Web-based control panel for XAMPP (see screenshot below).
Once you’ve installed XAMPP, you’ll see a shortcut called XAMPP Control Panel on your desktop. Double-click
this icon to control the servers you’ve just installed—you can turn the servers off and on, as well as turn them
into services (which launch each time you start up your computer).
To uninstall XAMPP, just go to the location where you installed XAMPP (like C:\XAMPP\) and run the program
named Uninstall.exe. This action, however, deletes any databases you created, and destroys any Web pages
that you placed on the server.
IIS
Internet Information Services (IIS, formerly Internet Information Server) is an extensible web server created by
Microsoft for use with Windows NT family.[2] IIS supports HTTP, HTTPS, FTP, FTPS, SMTP and NNTP. It has
been an integral part of the Windows NT family since Windows NT 4.0, though it may be absent from some
editions (e.g. Windows XP Home edition), and is not active by default.
4. Now, simply click on the features that are checked on the following screens and then hit the OK button
8. Now you can use Internet Information Services Manager to manage and configure IIS. To open IIS
Manager, click Start, type inetmgr in the Search Programs and Files box, and then press Enter.
Managing a virtual directory includes creating a virtual directory and its all settings. When IIS is installed a
directory named "c:/Inetpub/wwwroot" is created automatically.Any files in this directory will appear as
they're in the root of the web server.using the wwwroot directory fro creating a virtual directory makes a very
poor organisation so try to avoid it.That's why I coosen the second option as below
1. Go to run and type inetmgr and press enter. You will get IIS management console as below and do as the
screen shot.
5. Right Click on the Virtual Directory and go to properties and clock on create to set it as application
An ActiveX control is an object that supports a customizable, programmatic interface. Using the
methods, events, and properties exposed by a control, Web authors can automate their HTML pages.
Examples of ActiveX Controls include text boxes, command buttons, audio players, video players, stock
tickers, and so on.
You can develop ActiveX Controls using Microsoft Visual Basic, Microsoft Visual C++, and Java.
Assignment 4
Objective : Working with ActiveX Controls in web documents 5 Experiments in Java Server Pages: Implementing MVC
Architecture using Servlets, Data Access Programming (using ADO), Session and Application objects, File System
Management
Java server pages (JSP) is based on java languages and used to develop dynamic web pages JSP was developed
by Sun Microsystems to allow server side development. JSP files are HTML files with special Tags containing
Java source code that provide the dynamic content.JSP provide excellent server side scripting support for
creating database driven web applications. JSP is a java technology which allows developers to create wide
ranges of web services like ecommerce, banking ,corporate intranet banking. JSP combines HTML, XML, Java
Servlet and JavaBeans technologies into one highly productive technology which allow web developers to
develop reliable, high performance and platform independent web applications .
JSP stands for Java Server Pages, it is a kind of server side technology.It is used to host the dynamic data on
the web server and the product of Sun & part of J2EE.But now it is the product of Oracle Corpation.
JSP technology is used to create web application just like Servlet technology. It can be thought of as an
extension to servlet because it provides more functionality than servlet such as expression language, jstl etc.
A JSP page consists of HTML tags and JSP tags. The jsp pages are easier to maintain than servlet because we
can separate designing and development. It provides some additional features such as Expression Language,
Custom Tag etc.
JavaServer Pages often serve the same purpose as programs implemented using the Common Gateway
Interface (CGI). But JSP offer several advantages in comparison with the CGI.
Performance is significantly better because JSP allows embedding Dynamic Elements in HTML Pages
itself instead of having a separate CGI files.
JSP are always compiled before it's processed by the server unlike CGI/Perl which requires the server
to load an interpreter and the target script each time the page is requested.
JavaServer Pages are built on top of the Java Servlets API, so like Servlets, JSP also has access to all the
powerful Enterprise Java APIs, including JDBC, JNDI, EJB, JAXP etc.
JSP pages can be used in combination with servlets that handle the business logic, the model
supported by Java servlet template engines.
Advantages of JSP:
Following is the list of other advantages of using JSP over other technologies:
vs. Active Server Pages (ASP): The advantages of JSP are twofold. First, the dynamic part is written in
Java, not Visual Basic or other MS specific language, so it is more powerful and easier to use. Second, it
is portable to other operating systems and non-Microsoft Web servers.
vs. Pure Servlets: It is more convenient to write (and to modify!) regular HTML than to have plenty of
println statements that generate the HTML.
vs. Server-Side Includes (SSI): SSI is really only intended for simple inclusions, not for "real" programs
that use form data, make database connections, and the like.
vs. JavaScript: JavaScript can generate HTML dynamically on the client but can hardly interact with the
web server to perform complex tasks like database access and image processing etc.
vs. Static HTML: Regular HTML, of course, cannot contain dynamic information.
This step involves downloading an implementation of the Java Software Development Kit (SDK) and
setting up PATH environment variable appropriately.
You can download SDK from Oracle's Java site: Java SE Downloads.
Once you download your Java implementation, follow the given instructions to install and configure
the setup. Finally set PATH and JAVA_HOME environment variables to refer to the directory that
contains java and javac, typically java_install_dir/bin and java_install_dir respectively.
If you are running Windows and installed the SDK in C:\jdk1.5.0_20, you would put the following line in
your C:\autoexec.bat file.
set PATH=C:\jdk1.5.0_20\bin;%PATH%
set JAVA_HOME=C:\jdk1.5.0_20
On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk1.5.0_20 and you use the C shell,
you would put the following into your .cshrc file.
Alternatively, if you use an Integrated Development Environment (IDE) like Borland JBuilder, Eclipse,
IntelliJ IDEA, or Sun ONE Studio, compile and run a simple program to confirm that the IDE knows
where you installed Java.
Web Server
Setting up CLASSPATH
Since servlets are not part of the Java Platform, Standard Edition, you must identify the servlet classes
to the compiler.
If you are running Windows, you need to put the following lines in your C:\autoexec.bat file.
set CATALINA=C:\apache-tomcat-5.5.29
set CLASSPATH=%CATALINA%\common\lib\jsp-api.jar;%CLASSPATH%
Alternatively, on Windows NT/2000/XP, you could also right-click on My Computer, select Properties,
then Advanced, then Environment Variables. Then, you would update the CLASSPATH value and press
the OK button.
On Unix (Solaris, Linux, etc.), if you are using the C shell, you would put the following lines into your
.cshrc file.
setenv CATALINA=/usr/local/apache-tomcat-5.5.29
NOTE: Assuming that your development directory is C:\JSPDev (Windows) or /usr/JSPDev (Unix) then
you would need to add these directories as well in CLASSPATH in similar way as you have added above.
JSP page is create with write a html code, and save as .jsp extension. We have save this file as index.jsp. Put it
in a folder and paste the folder in the web-apps directory in apache tomcat to run the jsp page.
<html>
<body>
<% out.print(2*5); %>
</body>
<jsp:scriptlet>
code fragment
</jsp:scriptlet>
Any text, HTML tags, or JSP elements you write must be outside the scriptlet. Following is the simple and first
example for JSP:
<html>
<head><title>Hello World</title></head>
<body>
Hello World!<br/>
<%
out.println("Your IP address is " + request.getRemoteAddr());
%>
</body>
</html>
JSP Declarations:
A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You
must declare the variable or method before you use it in the JSP file.
Following is the syntax of JSP Declarations:
<%! declaration; [ declaration; ]+ ... %>
You can write XML equivalent of the above syntax as follows:
<jsp:declaration>
code fragment
</jsp:declaration>
Following is the simple example for JSP Declarations:
<%! int i = 0; %>
<%! int a, b, c; %>
<%! Circle a = new Circle(2.0); %>
JSP Expression:
A JSP expression element contains a scripting language expression that is evaluated, converted to a String, and
inserted where the expression appears in the JSP file.
Because the value of an expression is converted to a String, you can use an expression within a line of text,
whether or not it is tagged with HTML, in a JSP file.
The expression element can contain any expression that is valid according to the Java Language Specification
but you cannot use a semicolon to end an expression.
Following is the syntax of JSP Expression:
<%= expression %>
You can write XML equivalent of the above syntax as follows:
<jsp:expression>
expression
</jsp:expression>
Following is the simple example for JSP Expression:
<html>
<head><title>A Comment Test</title></head>
<body>
<p>
Today's date: <%= (new java.util.Date()).toLocaleString()%>
</p>
</body>
</html>
This would generate following result:
Today's date: 11-Sep-2010 21:24:25
<html>
<head><title>A Comment Test</title></head>
<body>
<h2>A Test of Comments</h2>
<%-- This comment will not be visible in the page source --%>
</body>
</html>
This would generate following result:
A Test of Comments
There are a small number of special constructs you can use in various cases to insert comments or characters
that would otherwise be treated specially. Here's a summary:
Syntax Purpose
Now look at the following switch...case block which has been written a bit differentlty using out.println() and
inside Scriptletas:
<%! int day = 3; %>
<html>
<head><title>SWITCH...CASE Example</title></head>
<body>
<%
switch(day) {
case 0:
out.println("It\'s Sunday.");
break;
case 1:
out.println("It\'s Monday.");
break;
Loop Statements:
You can also use three basic types of looping blocks in Java: for, while,and do…whileblocks in your JSP
programming.
Let us look at the following for loop example:
<%! int fontSize; %>
<html>
<head><title>FOR LOOP Example</title></head>
<body>
<%for ( fontSize = 1; fontSize <= 3; fontSize++){ %>
<font color="green" size="<%= fontSize %>">
JSP Tutorial
</font><br />
<%}%>
</body>
</html>
JSP Operators:
JSP supports all the logical and arithmetic operators supported by Java. Following table give a list of all the
operators with the highest precedence appear at the top of the table, those with the lowest appear at the
bottom.
Within an expression, higher precedence operators will be evaluated first.
Category Operator Associativity
Step 1(b) : click on file menu and select New Project then select Java Web and then Web Application as
follows.
Then we select "New Project" -> "Java Web" -> "Web Application" as in the following figure:
Step 1(d) :A new window is generated for the server and setting and go to the server and click on "Add
server".
Step 1(e) : Then after server path you can see two more options for username and password.This is your
choice whether you want your username and password or you want the default created by the Netbeans IDE.
Now click on "Finish".
After that a window is generated containing the default index.jsp file.
Step 3(c): And Now click on close and run the project, after that for running your project right-click on the
project and select "Run" as follows.
Servlet
Servlet technology is used to create web application (resides at server side and generates dynamic web page).
Servlet technology is robust and scalable because of java language. Before Servlet, CGI (Common Gateway
Interface) scripting language was popular as a server-side programming language. But there was many
disadvantages of this technology. We have discussed these disadvantages below.
Servlet Terminology
There are some key points that must be known by the servlet programmer like server, container, get
request, post request etc. Let's first discuss these points before starting the servlet technology.
1. HTTP
2. HTTP Request Types
3. Difference between Get and Post method
4. Container
5. Server and Difference between web server and application server
6. Content Type
7. Introduction of XML
8. Deployment
Every request has a header that tells the status of the client. There are many request methods. Get and Post
requests are mostly used.
GET
POST
HEAD
PUT
DELETE
OPTIONS
TRACE
HTTP Description
Request
POST Asks the server to accept the body info attached. It is like GET request with extra info sent with
the request.
HEAD Asks for only the header part of whatever a GET would return. Just like GET but with no body.
TRACE Asks for the loopback of the request message, for testing or troubleshooting.
PUT Says to put the enclosed info (the body) at the requested URL.
OPTIONS Asks for a list of the HTTP methods to which the thing at the request URL can respond
There are many differences between the Get and Post request. Let's see these differences:
GET POST
2) Get request is not secured because data is exposed in Post request is secured because data is not
URL bar. exposed in URL bar.
As we know that data is sent in request header in case of get request. It is the default request type. Let's see
what informations are sent to the
server.
As we know, in case of post request original data is sent in message body. Let's see how informations are
passed to the server in case of post
request.
Container
1. Web Server
2. Application Server
Web Server
Web server contains only web or servlet container. It can be used for servlet, jsp, struts, jsf etc. It can't be used
for EJB.
Application Server
Application server contains Web and EJB containers. It can be used for servlet, jsp, struts, jsf, ejb etc.
Content Type
Content Type is also known as MIME (Multipurpose internet Mail Extension) Type. It is a HTTP header that
provides the description about what are you sending to the browser.
text/html
text/plain
application/msword
application/vnd.ms-excel
Servlet API
The javax.servlet and javax.servlet.http packages represent interfaces and classes for servlet api.
The javax.servlet package contains many interfaces and classes that are used by the servlet or web container.
These are not specific to any protocol.
The javax.servlet.http package contains interfaces and classes that are responsible for http requests only.
Servlet Interface
Servlet interface provides common behaviour to all the servlets.
Servlet interface needs to be implemented for creating any servlet (either directly or indirectly). It provides 3
life cycle methods that are used to initialize the servlet, to service the requests, and to destroy the servlet and
2 non-life cycle methods.
There are 5 methods in Servlet interface. The init, service and destroy are the life cycle methods of servlet.
These are invoked by the web container.
Method Description
public void init(ServletConfig config) initializes the servlet. It is the life cycle method of servlet
and invoked by the web container only once.
public void service(ServletRequest provides response for the incoming request. It is invoked
request,ServletResponse response) at each request by the web container.
GenericServlet class
You may create a generic servlet by inheriting the GenericServlet class and providing the implementation of
the service method.
There are given 6 steps to create a servlet example. These steps are required for all the servers.
The mostly used approach is by extending HttpServlet because it provides http request specific method such
as doGet(), doPost(), doHead() etc.
Here, we are going to use apache tomcat server in this example. The steps are as follows:
Assignment
1. Create an MVC application in JSP using servlet.
Sol:
A user always sees the view and communicates with the controller. We will understand this using a sample login
application which will display a welcome username message and if the login fails, it will redirect to an error page.
Here is what we are going to create.
Requirements:
Eclipse IDE
Apache tomcat server
JSTL jar
Create a new Dynamic web project in eclipse by clicking File -> New -> Dynamic Web Project. Fill the details i.e.
project name, the server. Enter your project name as “MVCDemo”. You will get the following directory structure for
the project.
Create success.jsp, error.jsp and login.jsp and LoginController servlet, Authenticator class, User class in the packages
as shown in the images. Put the jstl.jar in WEB-INF/lib folder.
Now that we have file structure, put this code in corresponding files.
Code in logincontroller
public LoginController() {
super();
}
package mvcdemo.model;
public class Authenticator {
public String authenticate(String username, String password) {
if (("prasad".equalsIgnoreCase(username)) && ("password".equals(password))) {
return "success";
} else {
return "failure";
}
}
}
User.java
package mvcdemo.model;
error.jsp
</body>
</html>
login.jsp
success.jsp
web.xml
An Active Server Page (ASP) is an HTML page that includes one or morescripts (small embedded programs)
that are processed on a Microsoft Webserver before the page is sent to the user. An ASP is somewhat similar
to aserver-side include or a common gateway interface (CGI) application in that all involve programs that run
on the server, usually tailoring a page for the user. Typically, the script in the Web page at the server uses
input received as the result of the user's request for the page to access data from adatabase and then builds
or customizes the page on the fly before sending it to the requestor.
Note
This diagram shows default windows and window locations. The View menu allows you to display additional windows,
windows to suit your preferences. If changes have already been made to the window arrangement, what you see will n
JSP Servelets
Discussed in assignment 5.
PHP
PHP is an acronym for "PHP: Hypertext Preprocessor". PHP is a widely-used, open source scripting
language.PHP scripts are executed on the server.PHP is free to download and use
<?php
echo "Hello World!";
?>
</body>
</html>
PHP Arrays
An array stores multiple values in one single variable:
Example
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>
ASSIGNMENT - 1
1. CREATE A BASIC WEB PAGE WITH ASP.NET WITH LOGIN FUNCTION?
2. Create a web page using java servlets
3. Create a simple website in php.
Asynchronous JavaScript and XML.AJAX is an important front-end web technology that lets JavaScript
communicate with a web server. It lets you load new content without leaving the current page,
creating a better, faster experience for your web site's visitors.
Before you continue you should have a basic understanding of the following:
HTML / XHTML
CSS
JavaScript / DOM
How AJAX works?
Old versions of Internet Explorer (IE5 and IE6) uses an ActiveX Object:
variable=new ActiveXObject("Microsoft.XMLHTTP");
To handle all modern browsers, including IE5 and IE6, check if the browser supports the
XMLHttpRequest object. If it does, create an XMLHttpRequest object, if not, create an ActiveXObject:
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object:
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
Method Description
open(method,url,async) Specifies the type of request, the URL, and if the request should be
handled asynchronously or not.
GET or POST?
GET is simpler and faster than POST, and can be used in most cases.
However, always use POST requests when:
A cached file is not an option (update a file or database on the server)
Sending a large amount of data to the server (POST has no size limitations)
Sending user input (which can contain unknown characters), POST is more robust and secure than GET
To POST data like an HTML form, add an HTTP header with setRequestHeader(). Specify the data you
want to send in the send() method:
xmlhttp.open("POST","ajax_test.asp",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("fname=Henry&lname=Ford");
Method Description
The file can be any kind of file, like .txt and .xml, or server scripting files like .asp and .php (which can perform
actions on the server before sending the response back).
Server Response
To get the response from a server, use the responseText or responseXML property of the XMLHttpRequest
object.
Property Description
When a request to a server is sent, we want to perform some actions based on the response.
The onreadystatechange event is triggered every time the readyState changes.
The readyState property holds the status of the XMLHttpRequest.
Three important properties of the XMLHttpRequest object:
Property Description
onreadystatechange Stores a function (or the name of a function) to be called automatically each time the
readyState property changes
In the onreadystatechange event, we specify what will happen when the server response is ready to be
processed.
When readyState is 4 and status is 200, the response is ready:
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
Assignment 7
4. Write a program to change content using ajax.
<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
$hint = "";
</body>
</html>
WSDL
WSDL stands for Web Services Description Language
WSDL is an XML-based language for describing Web services.
WSDL is a W3C recommendation
SOAP
SOAP stands for Simple Object Access Protocol
SOAP is an XML based protocol for accessing Web Services.
SOAP is based on XML
SOAP is a W3C recommendation
RDF
RDF stands for Resource Description Framework
RDF is a framework for describing resources on the web
RDF is written in XML
RSS
RSS stands for Really Simple Syndication
RSS allows you to syndicate your site content
RSS defines an easy way to share and view headlines and content
RSS files can be automatically updated
RSS allows personalized views for different sites
RSS is written in XML
SOAP
Before you study SOAP you should have a basic understanding of XML and XML Namespaces.
What is SOAP?
SOAP stands for Simple Object Access Protocol
SOAP is a communication protocol
SOAP is for communication between applications
SOAP is a format for sending messages
SOAP communicates via Internet
SOAP is platform independent
SOAP is language independent
SOAP is based on XML
SOAP is simple and extensible
SOAP allows you to get around firewalls
SOAP is a W3C recommendation
Why SOAP?
It is important for application development to allow Internet communication between programs.
Today's applications communicate using Remote Procedure Calls (RPC) between objects like DCOM and
CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and
proxy servers will normally block this kind of traffic.
A better way to communicate between applications is over HTTP, because HTTP is supported by all Internet
browsers and servers. SOAP was created to accomplish this.
SOAP provides a way to communicate between applications running on different operating systems, with
different technologies and programming languages.
Syntax Rules
Here are some important syntax rules:
A SOAP message MUST be encoded using XML
A SOAP message MUST use the SOAP Envelope namespace
A SOAP message MUST use the SOAP Encoding namespace
A SOAP message must NOT contain a DTD reference
A SOAP message must NOT contain XML Processing Instructions
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
...
</soap:Header>
<soap:Body>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
Assignment - 9
1. Develop a small e-commerce application.
This application will have two module front-end and admin panel. Technologies we are using is
PHP, HTML, CSS, Jquery, MYSQL.
Tables :
UserMaster
Admin
ProductMaster
OrderMaster
TransactionMaster
Admin Pages
Login Page
Add Prodcut Page
Change Password Page
View Orders
UNIT -10
Application Development in cloud computing Environment
"Cloud computing" has dramatically changed how business applications are built and run. Delivering a new
application is now as fast as opening your internet browser. Platform as a service-- or PaaS-- is a proven model
for running applications without the hassle of maintaining the hardware and software infrastructure at your
company. Enterprises of all sizes have adopted PaaS solutions like salesforce.com for the simplicity, scalability
and reliability. PaaS applications that always have the latest features without constant upgrade pain.
We will use salesforce.com , Salesforce.com is a cloud computing and social enterprise Software as a Service
provider based in San Francisco. It was founded in March 1999, in part by former Oracle executive Marc
Benioff.
Next, fill in the form as follows to match this screen, then click Create:
UNIT – 11
ANEKA TOOL
Aneka is a market oriented Cloud development and management platform with rapid
application development and workload distribution capabilities. Aneka is an integrated
middleware package which allows you to seamlessly build and manage an interconnected
network in addition to accelerating development, deployment and management of distributed
applications using Microsoft .NET frameworks on these networks. It is market oriented since it
allows you to build, schedule, provision and monitor results using pricing, accounting, QoS/SLA
services in private and/or public (leased) network environments.