Ip Lab Manual Final1

80
1 EX.NO:01 /* INDIA MAP */ DATE:28-12-10 AIM: ALGORITHM: NAME: R.Arinathan Reg.No: 11608104011

Transcript of Ip Lab Manual Final1

Page 1: Ip Lab Manual Final1

1

EX.NO:01

/* INDIA MAP */

DATE:28-12-10

AIM:

ALGORITHM:

NAME: R.Arinathan

Reg.No: 11608104011

Page 2: Ip Lab Manual Final1

2

Source Code:

DEMOCSS.html

<html>

<head>

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

<title>

INDIA MAP - HOT SPOTED CITIES

</title>

</head>

<body>

<H1> INDIA MAP</H1>

<img src="file:///C:/Documents and Settings/Arinathan/My Documents/htmlpro/India_map.jpg" alt="INDIA MAP" width="517" height="594" usemap="#Indiamap" />

<map name="Indiamap">

<area shape="circle" coords="146,94,5" alt="Jammu" href="Jammu.html" />

<area shape="circle" coords="155,78,5" alt="Srinagar" href="Srinagar.html" />

<area shape="circle" coords="227,197,5" alt="Lucknow" href="Lucknow.html" />

<area shape="circle" coords="146,198,5" alt="Jaipur" href="Jaipur.html" />

<area shape="circle" coords="189,263,5" alt="Bhopal" href="Bhopal.html" />

<area shape="circle" coords="93,259,5" alt="Gandhi nagar" href="Gandhinagar.html" />

<area shape="circle" coords="95,345,5" alt="Mumbai" href="Mumbai.html" />

<area shape="circle" coords="191,378,5" alt="Hyderabad" href="Hyderabad.html" />

<area shape="circle" coords="173,457,5" alt="Banglore" href="Banglore.html" />

<area shape="circle" coords="318,325,5" alt="Bhuvaneshwar" href="Bhuvaneswar.html" />

NAME: R.Arinathan

Reg.No: 11608104011

Page 3: Ip Lab Manual Final1

3

<area shape="circle" coords="161,535,5" alt="Thiruvananthapuram" href="Thiruvananthapuram.html" />

<area shape="circle" coords="173,487,5" alt="CHENNAI" href="chennai.html" />

<area shape="circle" coords="115,410,5" alt="Goa" href="Goa.html" />

<area shape="circle" coords="306,226,5" alt="Patna" href="Patna.html" />

<area shape="circle" coords="355,270,5" alt="Kolkata" href="Kolkata.html" />

</map>

</BODY>

</HTML>

map.css

body{

text-align:center;

}

p{

margin-left: 100px;

margin-right:100px;

text-align:justify;

font-size:"18";

}

h1{

font-family:calibri;

font-size:48;

}

chennai.html

<html>

NAME: R.Arinathan

Reg.No: 11608104011

Page 4: Ip Lab Manual Final1

4

<head>

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

</head>

<body>

<h1>INDIA MAP</h1>

<br><br>

<h2> STATE: TAMIL NADU </H2>

<br><br>

<h3> CAPITAL: CHENNAI </h3>

</BODY>

</HTML>

NAME: R.Arinathan

Reg.No: 11608104011

Page 5: Ip Lab Manual Final1

5

OUTPUT:

RESULT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 6: Ip Lab Manual Final1

6

EX.NO:02

/* CASCADE STYLE SHEETS */

DATE:4-1-11

AIM:

ALGORITHM:

NAME: R.Arinathan

Reg.No: 11608104011

Page 7: Ip Lab Manual Final1

7

Source Code:

CSS.html

<html>

<head>

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

<title>

DEMO on CASCADE STYLE SHEETS

</title>

</head>

<body>

<h1> S.V.C.E.T </H1>

<h2> Chancellor's Desk </h2>

<img src="file:///D:/logo.jpg" align=left >

<p style="margin-left: 250px; text-align:justify; margin-right:30px">

As the Founder and Chancellor of S.V.C.E.T, I look back with enormous sense of pride, the amazing progress that our Institution has made within a short span of time.

This would not have been possible with the invaluable support

and contribution of faculty, student community, parents and my well wishers.

I strongly believe that serious, sincere and systematic services, surely secure supreme success.

</p>

<H3> Directors' Desk</H3>

<p style="margin-left: 250px;margin-right:30px;text-align:justify">

We are delighted to declare that our University reigns as the Supreme Star on the

Galaxy of Education Institutions, We, at S.V.C.E.T, do not just create

Sensititve Intellectuals, but Mould our students as Complete Men and Women. NAME: R.Arinathan

Reg.No: 11608104011

Page 8: Ip Lab Manual Final1

8

We instill values of life in them and let them our as Noble Citizens, this makes

our University unique. We would be grateful if the viewers could keep in mind that

</p><br>

<font face=calibri size="+2">

<i><pre>

“ Never be a source of perspiration

Always be a source of inspiration.”

</i></pre>

</font>

<p style="margin-left:50px">

We solicit your continued support and best wishes which would make our University

reach a Glorious pedestal and grow further in leaps and bounds.

<br>Mr. Marie Johnson ,B.E., MBA., M.Phil.,(Ph.D.)

<br>Mrs.Mariazeena Johnson , B.E., MBA., M.Phil.,(Ph.D.)

<br>Directors,

S.V.C.E.T </p>

<h5> Vice Chancellor's Desk</h5>

<p style="margin-left:50px; margin-right:30px;text-align:justify">

I owe you all a huge debt of gratitude for your patronage and good wishes. As the Vice-Chancellor of S.V.C.E.T,

I wish to highlight our principle which has always been service to the Academic world with discipline, diligence, dignity and dedication.

The word "Zietgeist"

Means Spirit of the time. Our University stands for this in principle and practice.

The viewers could not that the only place where successes comes before work is in the dictionary.

NAME: R.Arinathan

Reg.No: 11608104011

Page 9: Ip Lab Manual Final1

9

Dr.N.Manoharan, B.E.,M.E.,Ph.D.,

Vice Chancellor

S.V.C.E.TUniversity

</p>

<h2>Our Milestones</h2>

<img src="solarsystem.jpg" align=right>

<p style="margin-left:50px; margin-right:320px; text-align:justify">

S.V.C.E.Tfeels proud to have inaugurated the World’s Largest Solar Steam Cooking System on 1st of July,

2009 in the campus.At S.V.C.E.TUniversity, we have 110 concentrator dishes with an area of 1100 m<sup>2</sup>

(World’s largest installation in terms of the number of dishes and square metres of the reflecting concentrator dishes).

These solar steam cooking systems were developed by <a href="gadhia.html">M/s. Gadhia Solar Energy Systems Pvt. Ltd.</a>, Gujarat.

A solar-powered kitchen consumes lesser power and time than a conventional kitchen and ensures that a meal is cooked in half-an-hour,

whereas it may take one-and-a-half hour to cook the same using LPG. Unlike the LPG model, solar steam cooking system helps to keep the

kitchen clean and hygienic. This kitchen, by replacing LPG with solar dishes, saves nearly Rs. 20 lakhs every year.

Out of 365 days in a year, Tamilnadu experiences hot weather for 320 days and is ideal for tapping solar energy.

Surplus power generated from these solar dishes can be used for heating water. Nearly Rs. 7.5 lakhs is spent for LPG every month

for cooking food for the hostel residents. This cost is expected to come down by half. currently our university is doing more

research works in the solar system.

</p>

NAME: R.Arinathan

Reg.No: 11608104011

Page 10: Ip Lab Manual Final1

10

<h2> FEMFEST’09 </h2>

<img src="femfest.jpg" align=left>

<p style="margin-left:275px;margin-right:30px;text-align:justify">

S.V.C.E.Thad its greatest privilege and pleasure to celebrate

the extravaganza, FEMFEST’09 from 20 – 22 of February 2009.

It was college carnival conducted “FOR THE GIRLS, BY THE GIRLS”.

It was celebrated as a mark of the international women's day. Around 45

colleges from allover TamilNadu had participated and have won wonderful prizes worth Rs.5 lakh.

</p>

</body>

</html>

CASE.CSS

body{

text-align:center;

}

h1{

font-family:calibri;

font-size:48;

}

h2{

font-family:calibri;

font-size:36;

}

h3{

NAME: R.Arinathan

Reg.No: 11608104011

Page 11: Ip Lab Manual Final1

11

font-family:calibri;

font-size:24;

}

p{

font-family:Tahoma;

}

NAME: R.Arinathan

Reg.No: 11608104011

Page 12: Ip Lab Manual Final1

12

OUTPUT:

RESULT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 13: Ip Lab Manual Final1

13

EX.NO:03

/* FORM VALIDATION */

DATE:11-1-11

AIM:

ALGORITHM:

NAME: R.Arinathan

Reg.No: 11608104011

Page 14: Ip Lab Manual Final1

14

Source Code:

validation.html

<html>

<title>

S.V.C.E.T- THIRUPACHUR

</title>

<HEAD>

<SCRIPT language="javascript">

function gdata()

{

document.form1.MAX[2].value=Number(document.form1.MAX[1].value)+Number(document.form1.MAX[0].value);

document.form1.MAX1[2].value=Number(document.form1.MAX1[1].value)+Number(document.form1.MAX1[0].value);

document.form1.MAX2[2].value=Number(document.form1.MAX2[1].value)+Number(document.form1.MAX2[0].value);

document.form1.MAX3[2].value=Number(document.form1.MAX3[1].value)+Number(document.form1.MAX3[0].value);

document.form1.MAX4[2].value=Number(document.form1.MAX4[1].value)+Number(document.form1.MAX4[0].value);

document.form1.MAX5[2].value=Number(document.form1.MAX5[1].value)+Number(document.form1.MAX5[0].value);

document.form1.MAX6.value=Number(document.form1.MAX[2].value)+Number(document.form1.MAX1[2].value)+

Number(document.form1.MAX2[2].value)+Number(document.form1.MAX3[2].value)+

Number(document.form1.MAX4[2].value)+Number(document.form1.MAX5[2].value);

NAME: R.Arinathan

Reg.No: 11608104011

Page 15: Ip Lab Manual Final1

15

}

</SCRIPT>

<BODY>

<FORM NAME=form1>

<font face="calibri">

<TABLE HEIGHT=275 width=800 align="center">

<tr>

<tH colspan=3><h1><CENTER>

S.V.C.E.T

</CENTER>

</H1></th>

<TR>

<TH COLSPAN=3><H3> <color=”blue”>ANNA UNIVERSITY EXAMINATION MARKS SHEET </color></H3></TH>

<tr>

<TH COLSPAN=3> B.E - COMPUTER SCIENCE AND ENGNEERING

<TR>

<th> Name of the Student : P. RAVI KIRAN</th>

<th> Roll No : 29SFCS178 </th>

<th> SEM - II</th>

<TR>

<TABLE BORDER="1" WIDTH=800 HEIGHT=250 ALIGN=CENTER>

<tr ALIGN=CENTER>

<TH ROWSPAN=2> SUBJECT NAME

<TH COLSPAN=2> INTERNAL MARKS

NAME: R.Arinathan

Reg.No: 11608104011

Page 16: Ip Lab Manual Final1

16

<TH COLSPAN=2> EXTERNAL MARKS

<TH ROWSPAN=2> TOTAL

<TR>

<TH>MAX MARKS</TH>

<TH>MARKS OBTAINED</TH>

<TH>MAX MARKS</TH>

<TH>MARKS OBTAINED</TH>

</TR>

<tr ALIGN=CENTER>

<TD ALIGN=LEFT> OPERATING SYSTEMS

<TD> 20

<TD><INPUT TYPE=TEXT NAME="MAX" SIZE=4 MAXLENGTH=2></TD>

<TD> 80

<TD><INPUT TYPE=TEXT NAME="MAX" SIZE=4 MAXLENGTH=2></TD>

<TD><INPUT TYPE=TEXT NAME="MAX" SIZE=4 MAXLENGTH=2></TD>

<TR ALIGN=CENTER>

<TD ALIGN=LEFT> OPERATING SYSTEMS LAB

<TD> 20

<TD><INPUT TYPE=TEXT NAME="MAX1" SIZE=4 MAXLENGTH=2></TD>

<TD> 80

<TD><INPUT TYPE=TEXT NAME="MAX1" SIZE=4 MAXLENGTH=2></TD>

<TD><INPUT TYPE=TEXT NAME="MAX1" SIZE=4 MAXLENGTH=2></TD>

<TR ALIGN=CENTER>

<TD ALIGN=LEFT> DATABASE SYSTEMS

<TD> 20

NAME: R.Arinathan

Reg.No: 11608104011

Page 17: Ip Lab Manual Final1

17

<TD><INPUT TYPE=TEXT NAME="MAX2" SIZE=4 MAXLENGTH=2></TD>

<TD> 80

<TD><INPUT TYPE=TEXT NAME="MAX2" SIZE=4 MAXLENGTH=2></TD>

<TD><INPUT TYPE=TEXT NAME="MAX2" SIZE=4 MAXLENGTH=2></TD>

<TR ALIGN=CENTER>

<TD ALIGN=LEFT> SOFT COMPUTING

<TD> 20

<TD><INPUT TYPE=TEXT NAME="MAX3" SIZE=4 MAXLENGTH=2></TD>

<TD> 80

<TD><INPUT TYPE=TEXT NAME="MAX3" SIZE=4 MAXLENGTH=2></TD>

<TD><INPUT TYPE=TEXT NAME="MAX3" SIZE=4 MAXLENGTH=2></TD>

<TR ALIGN=CENTER>

<TD ALIGN=LEFT> MOBILE NETWORKING

<TD> 20

<TD><INPUT TYPE=TEXT NAME="MAX4" SIZE=4 MAXLENGTH=2></TD>

<TD> 80

<TD><INPUT TYPE=TEXT NAME="MAX4" SIZE=4 MAXLENGTH=2></TD>

<TD><INPUT TYPE=TEXT NAME="MAX4" SIZE=4 MAXLENGTH=2></TD>

<TR ALIGN=CENTER>

<TD ALIGN=LEFT> ADVANCED SOFTWARE ENGINEERING

<TD> 20

<TD><INPUT TYPE=TEXT NAME="MAX5" SIZE=4 MAXLENGTH=2></TD>

<TD> 80

<TD><INPUT TYPE=TEXT NAME="MAX5" SIZE=4 MAXLENGTH=2></TD>

<TD><INPUT TYPE=TEXT NAME="MAX5" SIZE=4 MAXLENGTH=2></TD>

NAME: R.Arinathan

Reg.No: 11608104011

Page 18: Ip Lab Manual Final1

18

<tr ALIGN=RIGHT>

<TD COLSPAN=5> <INPUT TYPE=BUTTON NAME="CALCULATE" VALUE="CALCULATE"onClick="gdata()"></TD>

<TD> <INPUT TYPE=TEXT NAME="MAX6" SIZE=4 MAXLENGTH=2></TD>

</TABLE>

</TR>

</table></font>

</FORM>

</BODY>

</html>

OUTPUT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 19: Ip Lab Manual Final1

19

RESULT:

EX.NO:04

NAME: R.Arinathan

Reg.No: 11608104011

Page 20: Ip Lab Manual Final1

20

/* APPLET PROGRAM ON COLOR PALETTE */

DATE:21-1-11

AIM:

ALGORITHM:

Source Code:

import java.awt.*;

NAME: R.Arinathan

Reg.No: 11608104011

Page 21: Ip Lab Manual Final1

21

import java.awt.event.*;

import java.util.*;

import javax.swing.*;

/* <applet code="pallet.class" width="400" height="400"> </applet> */

public class pallet extends JApplet implements ActionListener

{

Button bt[] = new Button[25];

Random r = new Random();

Checkbox c,c1;

TextArea ta;

int v1,v2,v3;

Panel p,p1;

GridLayout g;

public void init()

{

g = new GridLayout(5,5);

ta = new TextArea("Example Program",5,25);

p = new Panel();

p1 = new Panel();

p1.setLayout(g);

CheckboxGroup cbg = new CheckboxGroup();

c = new Checkbox("ForeGround",cbg,true);

c1 = new Checkbox("BackGround",cbg,true);

p.add(c);

NAME: R.Arinathan

Reg.No: 11608104011

Page 22: Ip Lab Manual Final1

22

p.add(c1);

p.add(ta);

for(int i=0;i<10;i++)

{

bt[i] = new Button();

p1.add(bt[i]);

v1 = r.nextInt(255);

v2 = r.nextInt(255);

v3 = r.nextInt(255);

Color cl = new Color(v1,v2,v3);

bt[i].setBackground(cl);

bt[i].addActionListener(this);

}

p.add(p1);

getContentPane().add(p);

}

public void actionPerformed(ActionEvent ae)

{

for(int i=0;i<10;i++)

{

if(ae.getSource() == bt[i])

{

Color cl = bt[i].getBackground();

if(c.getState() == true)

ta.setForeground(cl);

NAME: R.Arinathan

Reg.No: 11608104011

Page 23: Ip Lab Manual Final1

23

else

ta.setBackground(cl);

}

}

}

}

NAME: R.Arinathan

Reg.No: 11608104011

Page 24: Ip Lab Manual Final1

24

Output:

RESULT:

EX.NO:05NAME: R.Arinathan

Reg.No: 11608104011

Page 25: Ip Lab Manual Final1

25

/*Invoking Servlets from HTML Forms */

DATE:11-2-11

AIM:

ALGORITHM:

Index.jsp

NAME: R.Arinathan

Reg.No: 11608104011

Page 26: Ip Lab Manual Final1

26

<html>

<body>

<FORM name = "postparam" method = "get" action="postparam">

<TABLE>

<tr>

<td><B>Employee </B> </td>

<td><input type = "textbox" name="ename" size="25"

value=""></td>

</tr>

<tr>

<td><B>Phone </B> </td>

<td><input type = "textbox" name="phoneno" size="25"

value=""></td>

</tr>

</TABLE>

<INPUT type = "submit" name=”view” value="Submit">

</FORM>

</body>

</html>

postparam

import java.io.*;

import java.util.*;

import javax.servlet.*;

public class postparam extends GenericServlet {

NAME: R.Arinathan

Reg.No: 11608104011

Page 27: Ip Lab Manual Final1

27

public void service(ServletRequest request,ServletResponse response)

throws ServletException, IOException {

PrintWriter pw = response.getWriter();

Enumeration e = request.getParameterNames();

while(e.hasMoreElements()) {

String pname = (String)e.nextElement();

pw.print(pname + " = ");

String pvalue = request.getParameter(pname);

pw.println(pvalue);

}

pw.close();

}

}

OUTPUT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 28: Ip Lab Manual Final1

28

RESULT:

EX.NO:06

NAME: R.Arinathan

Reg.No: 11608104011

Page 29: Ip Lab Manual Final1

29

/*ONLINE EXAMINATION*/

DATE:18-2-11

AIM:

ALGORITHM:

PROGRAM:

NAME: R.Arinathan

Reg.No: 11608104011

Page 30: Ip Lab Manual Final1

30

Index.jsp

<html>

<body>

<h1><center>Online Examination</center></h1>

<form name=frm action="examserv" method="get" target=result>

<br>1.On successful Compilation a file with the class extention is created

<br><input type=radio name=opt1 value=true>True

<input type=radio name=opt1 value=False>False

<br><br>2.java.lang package is automatically imported into all programs

<br><input type=radio name=opt2 value=true>True

<input type=radio name=opt2 value=False>False

<br><br>3.The java program is encloased in a class defination

<br><input type=radio name=opt3 value=true>True

<input type=radio name=opt3 value=False>False

<br><br>4.The interpreter is used for the execution of source code

<br><input type=radio name=opt4 value=true>True

<input type=radio name=opt4 value=False>False

<br><br>5.Which of the following classes is used to perform basic console I/O?

<br><input type=radio name=opt5 value=system>system

<input type=radio name=opt5 value=math>math

<br><input type=radio name=opt5 value=secrity manager>secrity manager

<input type=radio name=opt5 value=runtime>runtime

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

</form>

</body>

NAME: R.Arinathan

Reg.No: 11608104011

Page 31: Ip Lab Manual Final1

31

</html>

examserv.java

import java.io.IOException;

import java.io.PrintWriter;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

public class examserv extends HttpServlet {

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

PrintWriter out = response.getWriter();

try {

out.println("<html>");

out.println("<head>");

out.println("<title>Servlet examserv</title>");

out.println("</head>");

out.println("<body>");

int score=0;

if(request.getParameter("opt1").equals("Santhanam"))

{

score+=5;

}

else

NAME: R.Arinathan

Reg.No: 11608104011

Page 32: Ip Lab Manual Final1

32

score-=2;

if(request.getParameter("opt2").equals("Eight"))

{

score+=5;

}

else

score-=2;

if(request.getParameter("opt3").equals("true"))

{

score+=5;

}

else

score-=2;

if(request.getParameter("opt4").equals("true"))

{

score+=5;

}

else

score-=2;

if(request.getParameter("opt5").equals("system"))

{

score+=5;

}

else

score-=2;

NAME: R.Arinathan

Reg.No: 11608104011

Page 33: Ip Lab Manual Final1

33

out.println("<h1> Your Score is : "+score+"</h1>");

out.println("</body>");

out.println("</html>");

} finally {

out.close();

}

}@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

}

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

}

public String getServletInfo() {

return "Short description";

}// </editor-fold>

}

OUTPUT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 34: Ip Lab Manual Final1

34

RESULT:

EX.NO:07

NAME: R.Arinathan

Reg.No: 11608104011

Page 35: Ip Lab Manual Final1

35

/* DISPLAYING STUDENT Marksheet*/

DATE:25-2-11

AIM:

ALGORITHM:

SOURCE CODE:

NAME: R.Arinathan

Reg.No: 11608104011

Page 36: Ip Lab Manual Final1

36

Index.jsp

<html>

<head>

<title>STUDENT MARK SHEET</title>

</head>

<body>

<center><h2> STUDENT MARK SHEET </h2></center>

<form action="stumark">

<table align=center>

<tr>

<td>Student Name</td>

<td><input type=text name=txtuser>

</tr>

<tr>

<td>Roll Number</td>

<td><input type=text name=txtroll>

</tr>

<tr>

<td>Web Technology</td>

<td><input type=text name=txtweb>

</tr>

<tr>

<td>Compiler Design</td>

<td><input type=text name=txtcd>

</tr>

NAME: R.Arinathan

Reg.No: 11608104011

Page 37: Ip Lab Manual Final1

37

<tr>

<td>OOAD</td>

<td><input type=text name=txtooad>

</tr>

<tr>

<td>Advanced Data Technology</td>

<td><input type=text name=txtadt>

</tr>

<tr>

<td>Artificail Intelligence</td>

<td><input type=text name=txtai>

</tr>

<tr>

<td>Advaced Computer Architecture</td>

<td><input type=text name=txtaca>

</tr>

<tr>

<td><input type=submit value=Submit >

<td><input type=reset id=reset1 name=reset1>

</tr>

</table>

</form>

</body>

</html>

stumark.java

NAME: R.Arinathan

Reg.No: 11608104011

Page 38: Ip Lab Manual Final1

38

import java.io.*;

import javax.servlet.*;

public class stumark extends GenericServlet

{

public void service(ServletRequest req,ServletResponse res) throws ServletException,IOException

{

PrintWriter out=res.getWriter();

out.println("<html><body><center>");

out.println("<form action="+"ser"+">");

String frame=req.getParameter("txtuser ");

out.println("Student Name: "+frame+"<br>");

frame=req.getParameter("txtroll");

out.println("Roll Number: "+frame+"<br>");

frame=req.getParameter("txtweb");

out.println("Web Technology: "+frame+"<br>");

frame=req.getParameter("txtcd");

out.println("Compiler Design: "+frame+"<br>");

frame=req.getParameter("txtooad");

out.println("OOAD: "+frame+"<br>");

frame=req.getParameter("txtadt");

out.println("Advanced Database Technology: "+frame+"<br>");

frame=req.getParameter("txtai");

out.println("Artificial Intelligence: "+frame+"<br>");

frame=req.getParameter("txtaca");

NAME: R.Arinathan

Reg.No: 11608104011

Page 39: Ip Lab Manual Final1

39

out.println("Advanced Computer Architecture: "+frame+"<br>");

out.println("<input type=submit value="+"Verified"+"><br>");

out.println("</center></body></html>");

out.close();

}

}

ser.java

import java.io.IOException;

import java.io.PrintWriter;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

public class ser extends HttpServlet {

protected void processRequest(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html;charset=UTF-8");

PrintWriter out = response.getWriter();

try {

out.println("<html>");

out.println("<head>");

out.println("<title>Servlet ser</title>");

out.println("</head>");

out.println("<body>");

out.println("<h1> Your form has been submited </h1>");

NAME: R.Arinathan

Reg.No: 11608104011

Page 40: Ip Lab Manual Final1

40

out.println("</body>");

out.println("</html>");

} finally {

out.close();

}

}

@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

}

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

processRequest(request, response);

}

@Override

public String getServletInfo() {

return "Short description";

}// </editor-fold>

}

OUTPUT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 41: Ip Lab Manual Final1

41

NAME: R.Arinathan

Reg.No: 11608104011

Page 42: Ip Lab Manual Final1

42

RESULT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 43: Ip Lab Manual Final1

43

EX.NO:08

/* PROGRAMS USING XML-SCHEMA-XSLT/XSL*/

DATE:1-3-11

AIM:

ALGORITHM:

NAME: R.Arinathan

Reg.No: 11608104011

Page 44: Ip Lab Manual Final1

44

Sports.xml

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

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

<catalog>

<cd>

<id>783</id>

<name>Cricket</name>

<paragraph>It Is most popular in India</paragraph>

<id1>345</id1>

<name1>Tennis</name1>

<paragraph1>It Is most popular in London</paragraph1>

<id2>445</id2>

<name2>Soccer</name2>

<paragraph2>It Is most popular in America</paragraph2>

</cd>

</catalog>

Games.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>

<h2>My CD Collection</h2>

<table border="1">

NAME: R.Arinathan

Reg.No: 11608104011

Page 45: Ip Lab Manual Final1

45

<tr bgcolor="#9acd32">

<th>ID</th>

<th>Name</th>

<th>paragraph</th>

</tr>

<xsl:for-each select="catalog/cd">

<tr>

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

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

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

</tr>

</xsl:for-each>

<xsl:for-each select="catalog/cd">

<tr>

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

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

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

</tr>

</xsl:for-each>

<xsl:for-each select="catalog/cd">

<tr>

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

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

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

</tr>

NAME: R.Arinathan

Reg.No: 11608104011

Page 46: Ip Lab Manual Final1

46

</xsl:for-each>

</table>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

NAME: R.Arinathan

Reg.No: 11608104011

Page 47: Ip Lab Manual Final1

47

OUTPUT:

RESULT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 48: Ip Lab Manual Final1

48

EX.NO:09

PROGRAMS USING AJAX

DATE:11-3-11

AIM:

ALGORITHM:

NAME: R.Arinathan

Reg.No: 11608104011

Page 49: Ip Lab Manual Final1

49

CODING:

<html>

<head>

<script type="text/javascript">

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();

}

NAME: R.Arinathan

Reg.No: 11608104011

Page 50: Ip Lab Manual Final1

50

</script>

</head>

<body>

<div id="myDiv"><h2>Let AJAX change this text</h2></div>

<button type="button" onclick="loadXMLDoc()">Change Content</button>

</body>

</html>

Ajax_info.txt

hi Hari! Welcome to Ajax World!

NAME: R.Arinathan

Reg.No: 11608104011

Page 51: Ip Lab Manual Final1

51

OUTPUT:

RESULT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 52: Ip Lab Manual Final1

52

EX.NO:10

Writing a Arithmetic operation in webservice accessing by client

DATE:11-3-11

AIM:

ALGORITHM:

NAME: R.Arinathan

Reg.No: 11608104011

Page 53: Ip Lab Manual Final1

53

ARITHMETIC OPERATION:

NAME: R.Arinathan

Reg.No: 11608104011

Page 54: Ip Lab Manual Final1

54

i) Addition(server):

package pack;

import javax.jws.WebMethod;

import javax.jws.WebParam;

import javax.jws.WebService;

@WebService()

public class arithmetric {

float c;

@WebMethod(operationName = "add")

public String add(@WebParam(name = "a")

final float a, @WebParam(name = "b")

final float b) {

c=a+b;

return "The addition value is:"+c;

}

}

Add.java(Client1)

public class add {

public static void main(String[] args)

{

try {

pack.ArithmetricService service = new pack.ArithmetricService();

pack.Arithmetric port = service.getArithmetricPort();

float a = 15.8f;

float b = 7.6f;

NAME: R.Arinathan

Reg.No: 11608104011

Page 55: Ip Lab Manual Final1

55

java.lang.String result = port.add(a, b);

System.out.println("Result = "+result);

} catch (Exception ex) {}

}

}

OUTPUT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 56: Ip Lab Manual Final1

56

SERVER:

CLIENT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 57: Ip Lab Manual Final1

57

ii) Subtraction:(server)

NAME: R.Arinathan

Reg.No: 11608104011

Page 58: Ip Lab Manual Final1

58

package pack;

import javax.jws.WebMethod;

import javax.jws.WebParam;

import javax.jws.WebService;

@WebService()

public class arthmatic {

float c;

@WebMethod(operationName = "sub")

public String sub(@WebParam(name = "a")

final float a, @WebParam(name = "b")

final float b) {

c=a-b;

return "The subtraction value is:"+c;

}

}

Sub.java(client):

public class sub {

public static void main(String[] args)

{

try {

pack.ArthmaticService service = new pack.ArthmaticService();

pack.Arthmatic port = service.getArthmaticPort();

float a = 15.3f;

float b = 10.9f;

java.lang.String result = port.sub(a, b);

NAME: R.Arinathan

Reg.No: 11608104011

Page 59: Ip Lab Manual Final1

59

System.out.println("Result = "+result);

} catch (Exception ex) { }

}

}

OUTPUT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 60: Ip Lab Manual Final1

60

SERVER:

CLIENT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 61: Ip Lab Manual Final1

61

iii) Multiplication(server):

package pack;NAME: R.Arinathan

Reg.No: 11608104011

Page 62: Ip Lab Manual Final1

62

import javax.jws.WebMethod;

import javax.jws.WebParam;

import javax.jws.WebService;

@WebService()

public class arithmetic {

@WebMethod(operationName = "multiplication")

public String multiplication(@WebParam(name = "a")

final float a, @WebParam(name = "b")

final float b) {

c=a*b;

return "The multiplication value is:"+c;

}

}

Mul.java(client)

public class mul {

public static void main(String[] args)

{

try {

pack.ArithmeticService service = new pack.ArithmeticService();

pack.Arithmetic port = service.getArithmeticPort();

float a = 3.6f;

float b = 1.6f;

java.lang.String result = port.multiplication(a, b);

System.out.println("Result = "+result);

} catch (Exception ex) {

NAME: R.Arinathan

Reg.No: 11608104011

Page 63: Ip Lab Manual Final1

63

}

}

}

OUTPUT:

SERVER

NAME: R.Arinathan

Reg.No: 11608104011

Page 64: Ip Lab Manual Final1

64

CLIENT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 65: Ip Lab Manual Final1

65

iv) Division(server):

NAME: R.Arinathan

Reg.No: 11608104011

Page 66: Ip Lab Manual Final1

66

package pack;

import javax.jws.WebMethod;

import javax.jws.WebParam;

import javax.jws.WebService;

@WebService()

public class arithmetic {

float c;

@WebMethod(operationName = "division")

public String division(@WebParam(name = "a")

final float a, @WebParam(name = "b")

final float b) {

c=a/b;

return "The division value is"+c;

}

}

div.java(client):

public class div {

public static void main(String[] args)

{

try {

pack.ArithmeticService service = new pack.ArithmeticService();

pack.Arithmetic port = service.getArithmeticPort();

float a = 15.3f;

float b = 5.3f;

java.lang.String result = port.division(a, b);

NAME: R.Arinathan

Reg.No: 11608104011

Page 67: Ip Lab Manual Final1

67

System.out.println("Result = "+result);

} catch (Exception ex) {

}

}

}

OUTPUT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 68: Ip Lab Manual Final1

68

SERVER:

CLIENT:

NAME: R.Arinathan

Reg.No: 11608104011

Page 69: Ip Lab Manual Final1

69

RESULT:

NAME: R.Arinathan

Reg.No: 11608104011