You are on page 1of 81

GKMCET

LAB PROGRAMS & ALGORITHM


Subject Code : CS2358

subject : Internet Programming lab

1.CREATING AND USING IMAGE MAPS

AIM:
To create a webpage with the following using HTML

To embed an image in web page


To fix the hot spots.
Show all the related information when a hot spot is clicked in the map

/
k
t

ALGORITHM:

Create a html file with map tag.


Set the source attribute of the img tag to the location of the image and also set the use
map attribute.
Specify an area with name, shape and href set of the appropriate value.
Repeat step3 as many hot spots you want to put in the map.
Create html file for each and every hot spots the user will select the particular location it
shows information about it.

.
e
b

u
t
e

s
c
/

/
:
p

PROGRAM:

t
t
h

SOLARSYSTEM.HTML

<HTML>
<HEAD>
<TITLE>solar system</TITLE>
</HEAD>
<BODY>
<img src="p1.jpg" width="600" height="500" usemap="#metroid" ismap="ismap" >

<map name ="metroid" id="metroid">

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<area href ="Mercury.html" shape = "rect" coords = "100,400,150,450" title = "Mercury planet" />
<area href ="venus.html" shape = "poly" coords = "150, 415, 175,348,265,360,190,420,190,440" title
="venus planet"/>
<area href ='earth.html' shape='circle' coords='175,495,180' title='Earth planet'/>
<area href ='mars.html' shape='circle' coords='175,495,230' title='Mars planet'/>
</map>

</BODY>

/
k
t

</HTML>

.
e
b

MERCURY.HTML

u
t
e

s
c
/

<HTML>
<HEAD>

/
:
p

<TITLE>About Mercury</TITLE>
</HEAD>
<BODY>

t
t
h

<CENTER> <H1>Mercury Planet</H1> </CENTER>


<p>
Mercury is the innermost and smallest planet in the Solar System,orbiting the Sun once every
87.969 Earth days.The orbit of Mercury has the highest eccentricity of all the Solar System planets, and
it has the smallest axial tilt.It completes three rotations about its axis for every two orbits.The perihelion
of Mercury's orbit precesses around the Sun at an excess of 43 arcseconds per century; a phenomenon
that was explained in the 20th century by Albert Einstein's General Theory of Relativity.

</p>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<a href='solarsystem.html'>solar planet</a>


</BODY>
</HTML>

VENUS.HTML

<HTML>
<HEAD>

/
k
t

<TITLE>About Mercury</TITLE>

.
e
b

</HEAD>

u
t
e

<BODY>
<CENTER> <H1>Venus Planet</H1> </CENTER>

s
c
/

<p>

/
:
p

Venus is the second planet from the Sun and the sixth largest. Venus' orbit is the most nearly circular of
that of any planet, with an eccentricity of less than 1%.

t
t
h

orbit: 108,200,000 km (0.72 AU) from Sun


diameter: 12,103.6 km
mass:

4.869e24 kg

Venus has been known since prehistoric times. It is the brightest object in the sky except for the Sun and
the Moon.
</p>
<a href='solarsystem.html'>solar planet</a>
</BODY>
</HTML>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

EARTH.HTML

<HTML>
<HEAD>
<TITLE>About Mercury</TITLE>
</HEAD>
<BODY>
<CENTER> <H1>Earth Planet</H1> </CENTER>

/
k
t

<p>

.
e
b

Earth is the third planet from the Sun and the fifth largest:

u
t
e

orbit: 149,600,000 km (1.00 AU) from Sun


diameter: 12,756.3 km
mass:

s
c
/

5.972e24 kg

/
:
p

t
t
h

Earth is the only planet whose English name does not derive from Greek/Roman mythology. The name
derives from Old English and Germanic. There are, of course, hundreds of other names for the planet in
other languages. In Roman Mythology, the goddess of the Earth was Tellus - the fertile soil

</p>

<a href='solarsystem.html'>solar planet</a>


</BODY>
</HTML>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

MARS.HTML

<HTML>
<HEAD>
<TITLE>About Mercury</TITLE>
</HEAD>
<BODY>
<CENTER> <H1>Mars Planet</H1> </CENTER>

/
k
t

<p>

.
e
b

Mars is the fourth planet from the Sun and the seventh largest:

u
t
e

orbit: 227,940,000 km (1.52 AU) from Sun


diameter: 6,794 km

s
c
/

mass: 6.4219e23 kg

/
:
p

The first spacecraft to visit Mars was Mariner 4 in 1965. Several others followed including Mars
2, the first spacecraft to land on Mars and the two Viking landers in 1976. Ending a long 20 year hiatus,
Mars Pathfinder landed successfully on Mars on 1997 July 4. In 2004 the Mars Expedition Rovers "Spirit"
and "Opportunity" landed on Mars sending back geologic data and many pictures; they are still
operating after more than three years on M

t
t
h

</p>

<a href='solarsystem.html'>solar planet</a>


</BODY>
</HTML>

OUTPUT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

CASCADING STYLE SHEET


2.1 INLINE STYLE SHEET

AIM:
To create a webpage to implement inline style sheet.

ALGORITHM:

/
k
t

Create a html file.


Inside the head tag define the click reference, its type and set href.
Close the head tag.
Inside the body tag define the required heading h1,h2,hn paragraph.
Close the body tag and all opened tags.
Create the inline style sheet.
Define the style formats such as button and text to corresponding header.
Execute the program.

.
e
b

u
t
e

s
c
/

/
:
p

PROGRAM:
INLINE.HTML
<html>

t
t
h

<head>
<title>inline sheet</title>
</head>
<body>
<p style="font-family:Showcard Gothic">Welcome user..</p>
<p style="font-size:40pt;font-family:Microsoft sans serif">Gmail</p>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<p style="font-size:30pt;color:red;font-family:arial">The worlds largest spam free


Email provider</p>
<p style="font-size:30pt;color:blue;font-family:Kristen ITC">Old user login
here...</p>
<h4 style="font-family:Lucida Handwriting">User Name:<input type="text"
value=" ">@gmail.com.<br><br>
Password:<input type="password"value=""<br><br></h4>
<input type="submit" value="login">
<input type="reset"value="cancel"><br><br>

/
k
t

.
e
b

<p style="font-size:15pt;font-family=Lucida Handwriting">if u have your


username or password
<a href="pass.html">click</a>here<br>

u
t
e

s
c
<p style="font-size:15pt;font-family=fixedsys">if you are a new user
/
/
<a href="logon.html">logon</a>here</p>
:
p
t
</body>
t
h
</html>
LOGON.HTML
<html>
<head>
<title>hai</title>
</head>
<body>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<h4 style="font-family:Lucida Handwriting">User Name:<input type="text"


value=" ">@gmail.com.<br><br>
password:<input type="password" value=""><br><br>
new password:<input type="new password" value=""><br>
<br>
confirm password:<input type="confirm password"value=""><br><br>
<input type="submit" value="ok">

/
k
t

<input type="submit" value="cancel">

.
e
b

</body>

u
t
e

</html>
PASS.HTML

s
c
/

<html>

/
:
p

<head> <title>hai</title>

t
t
h

</head> <body>

<h1>welcome to gmail</h1>
</body>
</html>

OUTPUT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

CASCADING STYLE SHEET


2.2 EMBEDDED STYLE SHEET

AIM:
To create a webpage with the following using html

To embed the style sheet

ALGORITHM:

/
k
t

.
e
b

Create html file with the style tag, inside head tag.
Set the style such as font-family, font-size, color, left etc, for the heading
h1,h2,h6 and respectively.
Close the head tag.
Specify the heading and information required inside the body tag.
Close the opened tag.

u
t
e

s
c
/

/
:
p

PROGRAM:
<html>
<head>

t
t
h

<title> Embedded style sheet </title>


<style type="text/css">
h1
{
font-family:arial;
color:green;

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

}
h2
{
font-family:arial;
color:red;
left:20px;
}

/
k
t

h3

.
e
b

u
t
e

font-family:arial;

s
c
/

color:blue;
}

/
:
p

t
t
h

{
font-size:14pt;

font-family:verdana;
}
</style>
</head>
<body>
<h1> <center>EMBEDDED STYLE SHEET </h1>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<h2> Computer science and Engineering</h2>


<h3>
<p>
It is the best department.It has several lab facilities.
</p>
</h3>
</body>

/
k
t

</html>

.
e
b

OUTPUT:

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

CASCADING STYLE SHEET


2.3 EXTERNAL STYLE SHEET

AIM:
To create a webpage with the following using html

To implement external style sheet.

ALGORITHM:

Create a html file.


Inside the head tag define the link reference, its type and set href as ex.css.
Close the head tag.
Inside the body tag define the required heading h1,h2,h6 and paragraph.
Close the body tag and all opened tags.
Create the cascade style sheet file ex.css.
Define the style formats such as font color, font size, etc to the corresponding
headings and paragraph and same its as ex.css.

PROGRAM:
<html>
<head>

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

<link rel="stylesheet" type="text/css" href="ex.css"/>


</head>
<body> <center>
<h1> External style sheet</h1></center>
<h2><center>GKMCET</center></h2>
<p>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<h3>Our Institution consists of various departments:<br>


1.CSE<br>
2.ECE<br></h3>
</p>
</body>
</html>
EX.CSS

/
k
t

h1

.
e
b

u
t
e

font-family:arial;

s
c
/

color:red;
}
h2
{

/
:
p

t
t
h

font-family:verdana;
color:green;
}

OUTPUT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

3. VALIDATING WEB FORM CONTROL USING


DHTML

AIM:
To develop a program for validating web form control using DHTML.

ALGORITHM:

/
k
t

Start the program.


Define the title within the tag.
Give the script type within the script tag.
Validate each and every column as the box with the if condition.
If empty value are given or the block term are next then it is verified with certain
condition.
If values is empty then a message is been displayed.
Form is designed with GUI tool is description.
All buttons are processed accordingly.
Stop the program.

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

PROGRAM:
CODING:

<html>
<head>
<title>The Student Registration Form</title>
<script type=text/javascript>
function validate()
{

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

var i;
var name_str=document.my_form.name;
var phoneID=document.my_form.ph_txt;
var ph_str=document.my_form.ph_txt.value;
var str=document.my_form.Email_txt.value;
if((name_str.value==null)||(name_str.value==""))
{
alert("Enter Some Name")

/
k
t

return false

.
e
b

u
t
e

if(document.my_form.Age_txt.value=="")
{

s
c
/

alert("Enter Some Age")

/
:
p

return false
}

t
t
h

if((document.my_form.Age_txt.value<"5")&&(document.my_form.Age_txt.value>"21"))
{
alert("Invalid Age")
return false
}

if(ph_str.length<1||ph_str.length>11)
{

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

alert("Invalid Length of PHONE NUMBER")


return false
}
for(i=0;i<ph_str.length;i++)
{
var ch=ph_str.charAt(i);
if(((ch<"0")||(ch>"9")))

/
k
t

.
e
b

alert("Invalid PHONE NUMBER")

u
t
e

phoneID.focus()
return false

s
c
/

/
:
p

}
var index_at=str.indexOf("@")
var len=str.length

t
t
h

var index_dot=str.index(".")

var emailID=document.my_form.Email_txt
if((emailID.value==null)||(emailID.value==""))
{
alert("Please Enter Your Email_ID")
emailID.focus()
return false
}

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

if(str.indexOf("@")==-1)
{
alert("Invalid E_mail ID")
return false
}
if(str.indexOf(".")==-1||str.indexOf(".")==0||str.indexOf(".")==index_at)
{
alert("Invalid E_mail ID")

/
k
t

return false

.
e
b

if(str.indexOf("@",(index_at+1))!=-1)

s
c
/

/
:
p

alert("Invalid E_mail ID")


return false
}

u
t
e

t
t
h

if(str.indexOf(" ")!=-1)
{
alert("Invalid E_mail ID")
return false
}
if(!document.my_form.group1[0].checked&&!document.my_form.group1[0].checked)
{

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

alert("Please Select SEX")


return false
}
if(!document.my_form.group1[0].checked&&!document.my_form.group1[0].checked)
{
alert("Please Select SEX")
return false
}

/
k
t

return true

.
e
b

u
t
e

</script>
</head>

s
c
/

<body bgcolor=aqua>

/
:
p

<center><h2>APPLICATION FORM</h2></center>
<form name=my_form onsubmit=validate()>
<strong>

t
t
h

Name:&nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong>
<input type=text name=name><br/><br/>
<strong>
Age: &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong>
<input type=text name=Age_txt><br/><br/>
<strong>Phone no:&nbsp&nbsp</strong>
<input type=text name=ph_txt><br/><br/>
<strong>Email:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<input type=text name=Email_txt><br/><br/>

<strong>Sex:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong>
<input type="radio"name="group1"value="Male">Male &nbsp&nbsp&nbsp&nbsp

<input type="radio"name="group1"value="Female">Female<br/><br/><br/>
<strong>Hoby:</strong>
&nbsp&nbsp

/
k
t

.
e
b

<input type="checkbox"name="option1"value="singing">Singing<br/>

u
t
e

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type="checkbox"name="option1"value="reading">Reading<br/>

s
c
/

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

/
:
p

<input type="checkbox"name="option1"value="TV">Watching TV<br/><br/><br/>

t
t
h

<strong>country:</strong>

<select name="My_menu">
<option value="India">India</option>

<option value="China">china</option>

<option value=SriLanka>srilanka</option>
<option value=Italy>italy</option>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

</select>
<center><br>
<input type=submit value=submit></br>
</center>
</body>
</html>
OUTPUT:

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

4. CREATION OF COLOR PALETTE

AIM:
To write a java program to create applet with the following features create a color with
matrix of buttons
a. Set the background and foreground of the written text area by selecting a color from
color palette.
b. Order to select foreground or background use check control or radio button.
c. To set background images.

/
k
t

ALGORITHM:

.
e
b

Import all necessary package and classes.


Define a class that extends applet and implements action listener and item listener.
Declare an array of button to set colors, font check boxes for foreground and background.
Add the array of buttons in the init function.
In the action performed() method, do the following
a. Get the action command in the string, color.
b. If the foreground in checked the set the following color to the color.
c. If the background is changed then the bgcolor to the selector color.
Stop the program.

u
t
e

s
c
/

/
:
p

t
t
h

PROGRAM:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<applet code="exp" width=400 height=400>
</applet>*/
public class exp extends Applet implements ItemListener

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

{
int currcolor=5;
int flag=1;
String text="Click any of the buttons";
Button buttons[]=new Button[5];
String colours[]={"Red","Blue","Green","Yellow","Magenta"};
Image img;

/
k
t

CheckboxGroup cbg=new CheckboxGroup();


Checkbox box1=new Checkbox("Background Color",cbg,true);

.
e
b

Checkbox box2=new Checkbox("Text Color",cbg,false);

u
t
e

Checkbox box3=new Checkbox("Loading Image",cbg,false);


public void init()

s
c
/

/
:
p

for(int i=0;i<5;i++)
{

t
t
h

buttons[i]=new Button(" ");


add(buttons[i]);
}

buttons[0].setBackground(Color.red);
buttons[1].setBackground(Color.blue);
buttons[2].setBackground(Color.green);
buttons[3].setBackground(Color.yellow);
buttons[4].setBackground(Color.magenta);
add(box1);

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

add(box2);
add(box3);
box1.addItemListener(this);
box2.addItemListener(this);
box3.addItemListener(this);
}
public void itemStateChanged(ItemEvent ev)

/
k
t

{
if(box1.getState()==true)

.
e
b

flag=1;

u
t
e

else if(box2.getState()==true)
{

s
c
/

text="Default color is black";

/
:
p

flag=2;
}

t
t
h

else if(box3.getState()==true)
{
img=getImage(getDocumentBase(),"Water lilies.jpg");
flag=3;
}
repaint();
}
public void paint(Graphics g)
{

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

if(flag==2)
{
g.drawString(text,30,100);
switch(currcolor)
{
case 0:
g.setColor(Color.red);

/
k
t

break;
case 1:

.
e
b

g.setColor(Color.blue);

u
t
e

break;
case 2:

s
c
/

g.setColor(Color.green);

/
:
p

break;
case 3:

t
t
h

g.setColor(Color.yellow);
break;
case 4:

g.setColor(Color.magenta);
break;
case 5:
g.setColor(Color.black);
break;
}

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

g.drawString(text,30,100);
}
else if(flag==1)
{
g.drawString(text,30,100);
switch(currcolor)
{

/
k
t

case 0:
setBackground(Color.red);

.
e
b

break;

u
t
e

case 1:
setBackground(Color.blue);

s
c
/

break;

/
:
p

case 2:

t
t
h

setBackground(Color.green);
break;
case 3:

setBackground(Color.yellow);
break;
case 4:
setBackground(Color.magenta);
break;
case 5:
setBackground(Color.white);

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

break;
}
}
else if(flag==3)
{
g.drawImage(img,20,90,this);
}

/
k
t

}
public boolean action(Event e,Object o)

.
e
b

u
t
e

for(int i=0;i<5;i++)
{

s
c
/

if(e.target==buttons[i])

/
:
p

{
currcolor=i;

t
t
h

text="You have chosen "+colours[i];


repaint();
return true;
}
}
return false;
}
}

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

OUTPUT:

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

5.1 INVOKING SERVLET FROM HTML

AIM:
To write a html program for invoking servlet using html.

ALGORITHM:

In html program, define the html, head and title tag.


Then the title is Student Information Form and close the title and head tag.

/
k
t

Define the body tag inside the body tag create form and table simultaneously.

.
e
b

The table consists of following information Roll no, Student name, Address, Phone no
and total marks.

u
t
e

In the servlet program, import the summary package and create a own servlet class
extends with generic servlet.

s
c
/

In the service method defined to request and response.


Create the object and for print writer and get writer() value.

/
:
p

The enumeration object get the servlet request parameter.


Create objects for string method and it is displayed another object value received get
parameter of name received and displayed the value received value.

t
t
PROGRAM:h
Java coding:

import java.io.*;
import java.util.*;
import javax.servlet.*;
public class myservletdemo extends GenericServlet

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

{
public void service(ServletRequest req,ServletResponse res)
throws ServletException,IOException
{
PrintWriter out=res.getWriter();
Enumeration en=req.getParameterNames();
while(en.hasMoreElements())

/
k
t

{
String name_received=(String)en.nextElement();

.
e
b

u
t
e

out.print(name_received+"=");

s
c
/

String value_received=req.getParameter(name_received);
out.println(value_received);
out.println(" ");
}

/
:
p

t
t
h

out.close();
}
}

HTML coding

<html>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<head>
<title>Student Information Form</title>
</head>
<body>
<form name="form1"
action="http://localhost:8080/examples/servlet/myservletdemo">
<h1>STUDENT INFORMATION FORM</H1>

/
k
t

<h3>Enter student information in following fields-</h3>

.
e
b

<table>
<tr>
<td>Roll Number</td>

u
t
e

s
c
<td><input type="text" name="Roll
Number" size="25" value=" "></td>
/
/
</tr>
:
p
t
<tr>
t
h
<td>Student Name</td>
<td><input type="text" name="Student Name" size="25" value=" "></td>
</tr>
<tr>
<td>Student Address</td>
<td><input type="text" name="Student Address" size="50" value=" "></td>
</tr>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<tr>
<td>Phone</td>
<td><input type="text" name="Phone" size="10" value=" "></td>
</tr>
<tr>
<td>Total Marks</td>
<td><input type="text" name="Total Marks" size="25" value=" "></td>

/
k
t

</tr>
</table>

u
t
e

<input type="submit" value="submit">

s
c
/

</form>
</center>
</body>
</html>

.
e
b

/
:
p

t
t
h

OUTPUT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

5.2 INVOKING SERVLET FROM APPLET


AIM:
To invoke the servlet program from the applet.

ALGORITHM:

Start the program.


Import the necessary package and create the user defined class exp extends with applet
and also implemented to Item Listener.

/
k
t

Declare the same variable and assign its value.

Three checkbox fix in the webpage and it perform the sum of the operation in the
webpage.

.
e
b

Create the I no of buttons and each and every button has to be assigned the different
color.

u
t
e

Void item state changed() function is used and it get the state operation of the webpage.

s
c
/

Void paint() function and used to set the color and it also assign the background color.
Execute the program.

/
:
p

PROGRAM:
JAVA CODING:

t
t
h

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class exp5 extends Applet implements ItemListener
{
int currcolor=5;
int flag=1;

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

String text="click any of the button";


Button buttons[]=new Button[5];
String color[]={"red","blue","green","yellow","magenta"};
Image img;
CheckboxGroup cbg=new CheckboxGroup();
Checkbox box1=new Checkbox("Background color",cbg,true);
Checkbox box2=new Checkbox("textcolor",cbg,false);
Checkbox box3=new Checkbox("loading image",cbg,false);

/
k
t

public void init()

.
e
b

u
t
e

for(int i=0;i<5;i++)
{

s
c
/

buttons[i]=new Button(" ");

/
:
p

add(buttons[i]);
}

t
t
h

buttons[0].setBackground(Color.red);
buttons[1].setBackground(Color.blue);
buttons[2].setBackground(Color.green);
buttons[3].setBackground(Color.yellow);
buttons[4].setBackground(Color.magenta);
add(box1);
add(box2);
add(box3);
box1.addItemListener(this);

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

box2.addItemListener(this);
box3.addItemListener(this);
}
public void itemStateChanged(ItemEvent ev)
{
if(box1.getState()==true)
flag=1;
else if(box2.getState()==true)

/
k
t

.
e
b

text="Default color os black";

u
t
e

flag=2;
}

s
c
/

else if(box3.getState()==true)

/
:
p

img=getImage(getDocumentBase(), "Water lilies.jpg");


flag=3;
}

t
t
h

repaint();
}
public void paint(Graphics g)
{
if(flag==2)
{
g.drawString(text,30,100);

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

switch(currcolor)
{
case 0:
g.setColor(Color.red);
break;
case 1:
g.setColor(Color.blue);
break;

/
k
t

case 2:

.
e
b

g.setColor(Color.green);

u
t
e

break;
case 3:

s
c
/

g.setColor(Color.yellow);

/
:
p

break;
case 4:

t
t
h

g.setColor(Color.magenta);
break;
case 5:
g.setColor(Color.black);
break;
}
g.drawString(text,30,100);
}
else if(flag==1)

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

{
g.drawString(text,30,100);
switch(currcolor)
{
case 0:
setBackground(Color.red);
break;
case 1:

/
k
t

setBackground(Color.blue);

.
e
b

break;

u
t
e

case 2:
setBackground(Color.green);

s
c
/

break;

/
:
p

case 3:
setBackground(Color.yellow);
break;
case 4:

t
t
h

setBackground(Color.magenta);
break;
case 5:
setBackground(Color.white);
break;
}}
else if(flag==3)

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

{
g.drawImage(img,20,90,this);
}}
public boolean action(Event e,Object o)
{
for(int i=0;i<5;i++)
{
if(e.target==buttons[i])

/
k
t

.
e
b

currcolor=i;

u
t
e

text="you have chosen" +color[i];


repaint();

s
c
/

return true;

/
:
p

}}
return false;
}}

t
t
h

HTML CODING:

<html>
<head>
<title>color palette</title>
<applet code="exp5.class" width=400 height=400>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

</applet>
</head>
</html>

OUTPUT:

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

6. THREE TIER ARCHITECTURE USING JSP AND DATABASE

AIM:
To write a java servlet program to conduct online examination and to display student
mark list available in a database.

ALGORITHM:
HTML FILE:

/
k
t

Create a html file with form tag.


The form tag action=http://localhost:8080/example/servlet/exam.
Create a two textbox(name & seat number).
The 5 question are defined into true or false model and close the all tags.

.
e
b

u
t
e

JAVA FILE:

s
c
/

Import the necessary packages and declare class, class name in exam.
Declare the connection, statement and result set object.
Use the depost() for check the connection in JDBC:ODBC driver.
The data are insert into corresponding table.
The execute update() are update the database.
Display the table in after html file compilation.

/
:
p

t
t
h

PROGRAM:
html coding:

<html>
<head>
<title> Database test</title>
</head>
<body>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<center>
<form action="http://localhost:8080/examples/servlet/exam" method=POST>
<div align="left"><br>
<b>seat number:</b> <input type="text" name="Seat_no">
<div align="right"><br>
<b>Name:</b> <input type="text" name="Name" size="50"><br>
</div>
<br>

/
k
t

<br>

.
e
b

<b>1.Is JAVA a platform independency</b><br/>

u
t
e

<input type="radio" name="group1" value="True">True

<input type="radio" name="group1" value="False">False<br>

s
c
/

<b>2.ASP .NET is a client side programming</b><br/>

/
:
p

<input type="radio" name="group2" value="True">True


<input type="radio" name="group2" value="False">False<br>

t
t
h

<b>3.MATHEMATICS is the backbone of engineering</b><br/>


<input type="radio" name="group3" value="True">True
<input type="radio" name="group3" value="False">False<br>
<b>4.You are working in IBM machines</b><br/>
<input type="radio" name="group4" value="True">True
<input type="radio" name="group4" value="False">False<br>
<b>5.C++ is a fully OOP's language</b><br/>
<input type="radio" name="group5" value="True">True
<input type="radio" name="group5" value="False">False<br>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<br><br><br>
<center>
<input type="submit" value="submit"><br><br>
</center>
</form>
</body>
</html>

/
k
t

java coding

.
e
b

u
t
e

import java.sql.*;
import java.io.*;

s
c
/

import java.util.*;

/
:
p

import javax.servlet.*;

import javax.servlet.http.*;

t
t
h

public class exam extends HttpServlet


{

String message,Seat_no,Name,ans1,ans2,ans3,ans4,ans5;
int Total=0;
Connection connect;
Statement stmt =null;
ResultSet rs=null;
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

{
try
{
String url="jdbc:odbc:StudentDB2";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connect=DriverManager.getConnection(url," "," ");
message="Connection Successful";
}

/
k
t

catch(ClassNotFoundException cnfex)

.
e
b

u
t
e

cnfex.printStackTrace();
}

s
c
/

catch(SQLException sqlex)

/
:
p

sqlex.printStackTrace();
}

t
t
h

catch(Exception excp)
{

excp.printStackTrace();
}
Seat_no=request.getParameter("Seat_no");
Name=request.getParameter("Name");
ans1=request.getParameter("group1");
ans2=request.getParameter("group2");

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

ans3=request.getParameter("group3");
ans4=request.getParameter("group4");
ans5=request.getParameter("group5");
if(ans1.equals("True"))
Total+=2;
if(ans2.equals("False"))
Total+=2;
if(ans3.equals("True"))

/
k
t

Total+=2;

.
e
b

if(ans4.equals("True"))

u
t
e

Total+=2;
if(ans5.equals("False"))

s
c
/

Total+=2;

/
:
p

try
{

t
t
h

Statement stmt=connect.createStatement();
String query="insert into
StudentTable("+Seat_no+",'"+Name+"',"+Total+")";//*****"+"Seat_no,Name,Marks"+")"+" VALUES("
int result=stmt.executeUpdate(query);
stmt.close();
}
catch(SQLException ex)
{
}

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("<html>");
out.println("<body bgcolor=yellow>");
out.println("<h1>"+message+"</h1>\n");
out.println("<h3>DataBase Updated");
out.println("<br><br>");
out.println("<b>"+"The Student Database is as follows");

/
k
t

out.println("<table border=5>");

.
e
b

try

u
t
e

{
Statement stmt=connect.createStatement();

s
c
/

String query="SELECT * FROM StudentTable";

/
:
p

rs=stmt.executeQuery(query);

out.println("<th>"+"Seat_no"+"</th>");

t
t
h

out.println("<th>"+"Name"+"</th>");
out.println("<th>"+"Marks"+"</th>");
while(rs.next())
{
out.println("<tr>");
out.println("<td>"+rs.getInt(1)+"</td>");
out.println("<td>"+rs.getString(2)+"</td>");
out.println("<td>"+rs.getInt(3)+"</td>");
out.println("</tr>");

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

}
out.println("</table>");
}
catch(SQLException ex)
{}
finally
{
try

/
k
t

.
e
b

if(rs!=null)

u
t
e

rs.close();
if(stmt!=null)

s
c
/

stmt.close();

/
:
p

if(connect!=null)
connect.close();
}

t
t
h

catch(SQLException e)
{}
}

out.println("<center>");
out.println("<h1>Thanks!</h1>\n");
out.println("</center>");
out.println("</body></html>");
}}

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

Output:

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

7. PROGRAM USING XML SCHEMA- XSLT/XSL

AIM:
To write a program for implementing student information using XML & XSL.

ALGORITHM:

The XML document reference to the XSL document.


The create the student information in the student tag and insert the same information
about the student.
Close all opened tags.
In XSL document create a html file include the student information in table format.
Close the necessary tags.

/
k
t

.
e
b

u
t
e

PROGRAM:

s
c
/

//SimpleXML.xml
<?xml version="1.0" encoding="UTF-8"?>

/
:
p

<?xml-stylesheet type="text/xsl" href="SimpleXml.xsl"?>


<Student>
<person-Details>

t
t
h

<name>Raj</name>
<address>Chennai</address>
<std>Third</std>
<marks>89 percent</marks>
</person-Details>
<person-Details>
<name>Ram</name>
<address>Chennai</address>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<std>Third</std>
<marks>98 percent</marks>
</person-Details>
<person-Details>H
<name>Raju</name>
<address>madurai</address>
<std>Third</std>
<marks>90 percent</marks>

/
k
t

</person-Details>

.
e
b

<person-Details>

u
t
e

<name>Ragav</name>
<address>erode</address>

s
c
/

<std>Third</std>

/
:
p

<marks>73 percent</marks>
</person-Details>
</Student>

t
t
h

SimpleXml.xsl

<?xml version="1.0" encoding="ISO-8859-1"?>


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<h2>Student DataBase</h2>
<table border="1">
<tr bgcolor="red">
<th>Name</th>
<th>Address</th>
<th>Standard</th>
<th>Marks</th>
</tr>

/
k
t

<xsl:for-each select="Student/person-Details">

.
e
b

<tr bgcolor="pink">

u
t
e

<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="address"/></td>

s
c
/

<td><xsl:value-of select="std"/></td>

/
:
p

<td><xsl:value-of select="marks"/></td>
</tr>
</xsl:for-each>
</table>

t
t
h

</body>
</html>
</xsl:template>
</xsl:stylesheet>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

OUTPUT:

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

8.1 DOM BASED PROGRAM

AIM:
To write a program for implementing student information XML document is well formed
or not using DOM.

ALGORITHM:

/
k
t

In java program, import the necessary package and declare the class parsing-DOM demo.
In that main function display enter the name of the XML document and get the input
from the buffer reader object.
Then create a file object and it assign to buffered reader value.
The input source is filename, then it is well formed otherwise it is not well formed.
In XML program create the student information and the java file complete and display
the output.

.
e
b

u
t
e

s
c
/

/
:
p

PROGRAM:
Java Coding:

t
t
h

//Parsing_DOMDemo.java

import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
public class Parsing_DOMDemo
{

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

public static void main(String[] arg)


{
try
{
System.out.print("Enter the name of XML document");
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
String file_name=input.readLine();
File fp=new File(file_name);

/
k
t

if(fp.exists())

.
e
b

u
t
e

try
{

s
c
/

DocumentBuilderFactory Factory_obj=DocumentBuilderFactory.newInstance();

/
:
p

DocumentBuilder builder=Factory_obj.newDocumentBuilder();
InputSource ip_src=new InputSource(file_name);

t
t
h

Document doc=builder.parse(ip_src);
System.out.println(file_name+"is well formed!");
}
catch(Exception e)
{
System.out.println(file_name+"is not well-formed!");
System.exit(1);
}
}

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

else
{
System.out.print("File not found!");
}
}
catch(IOException ex)
{
ex.printStackTrace();

/
k
t

.
e
b

u
t
e

s
c
/

XML Cding:

//Student1.xml:

/
:
p

t
t
h

<?xml version="1.0"?>
<student>

<Roll_No>10</Roll_No>
<Personal_Info>
<Name>Parth</Name>
<Address>Pune</Address>
<Phone>12345672</Phone>
</Personal_Info>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

<class>Second</class>
<Subject>Mathematics</Subject>
<Marks>100</Marks>
<Roll_No>20</Roll_No>
<Personal_Info>
<Name>Anu</Name>
<Address>Banglore</Address>
<Phone>78956897</Phone>

/
k
t

</Personal_Info>

.
e
b

<class>Fifth</class>

u
t
e

<Subject>English</Subject>
<Marks>90</Marks>

s
c
/

<Roll_No>30</Roll_No>

/
:
p

<Personal_Info>
<Name>priya</Name>

t
t
h

<Address>Trichy</Address>

<Phone>78956897</Phone>
</Personal_Info>
<class>Fifth</class>
<Subject>Tamil</Subject>
<Marks>90</Marks>
</student>

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

OUTPUT:
C:\Documents and Settings\user>cd C:\Program Files\Java\jdk1.6.0_13\bin

C:\Program Files\Java\jdk1.6.0_13\bin>javac Parsing_DOMDemo.java

C:\Program Files\Java\jdk1.6.0_13\bin>java Parsing_DOMDemo

/
k
t

Enter the name of XML documentstudent1.xml


student1.xmlis well formed!

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

8.2 PROGRAM USING SAX

AIM:
To write a program for student information XML document is well-formed or not using
SAX.

/
k
t

ALGORITHM:

.
e
b

In java program, input the necessary packages and declare the classname is parsingSAXDEMO.
In the main function display the Enter the XML document name manage and it get the
buffered reader object.
A new file is created and it exists then it is well formed, otherwise its not well formed.
Else file is not passed message will be displayed.
In XML document create the student information.

u
t
e

s
c
/

/
:
p

PROGRAM:
import java.io.*;

t
t
h

import org.xml.sax.*;

import org.xml.sax.helpers.*;
public class Parsing_SAXDemo
{
public static void main(String[] args) throws IOException
{
try
{
System.out.print("Enter the name of XML document");

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

BufferedReader input=new BufferedReader(new


InputStreamReader(System.in));
String file_name=input.readLine();
File fp=new File(file_name);
if(fp.exists())
{
try
{
XMLReader reader=XMLReaderFactory.createXMLReader();

/
k
t

reader.parse(file_name);

System.out.print(file_name+"is well-formed.");

.
e
b

}
catch(Exception e)

u
t
e

s
c
/

System.out.print(file_name+"is not well-formed.");


System.exit(1);

/
:
p
}

t
t
h
else
{

System.out.print("File is not present:"+file_name);


}
}
catch(IOException ex)
{
ex.printStackTrace();
}
}
}

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

//student.xml
<?xml version="1.0"?>
<student>
<Roll_no>10</Roll_no>
<Personal_Info>
<Name>path</Name>
<Address>Pune</Address>
<phone>1234567890</phone>
</Personal_Info>

/
k
t

<class>Second</class>
<Subject>Mathematics</Subject>

.
e
b

<Marks>100</Marks>

u
t
e

</student>
OUTPUT:

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

9. PROGRAM USING AJAX

AIM:
To write a html program using AJAX.

ALGORITHM:

Start the program.


Create the function named load XMLDOC().
In that print the message as AJAX changed the text here.
By using the button, onclick function.
Call the defined function.
Stop the program.

/
k
t

.
e
b

u
t
e

PROGRAM:

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

10. AIRLINE RESERVATION SYSTEM USING WEBSERVICES


AND DATABASE

AIM:
To create an airline reservation service and a travel agent and the travel agent is searching
for an airline using webservices and database.

/
k
t

ALGORITHM:

.
e
b

Start the program.


In html program in form action call the servlet using the post method.
In this get the starting point in the text box.
Create the button to submit.
In java program, declare the variables.
Create the connection for database (ie) DSN connection.\
While executing program the servlet is involved.
The starting location will be updated in the database table.
Stop the tomcat server.

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

http://csetube.weebly.com/

GKMCET
LAB PROGRAMS & ALGORITHM
Subject Code : CS2358

subject : Internet Programming lab

/
k
t

.
e
b

u
t
e

s
c
/

/
:
p

t
t
h

RESULT:

http://csetube.weebly.com/

You might also like