FirstRanker Logo

FirstRanker.com - FirstRanker's Choice is a hub of Question Papers & Study Materials for B-Tech, B.E, M-Tech, MCA, M.Sc, MBBS, BDS, MBA, B.Sc, Degree, B.Sc Nursing, B-Pharmacy, D-Pharmacy, MD, Medical, Dental, Engineering students. All services of FirstRanker.com are FREE

📱

Get the MBBS Question Bank Android App

Access previous years' papers, solved question papers, notes, and more on the go!

Install From Play Store

Download Anna University B-Tech CSE 5th Sem CS6512 Internet Programming IP Lab Manual Question Paper

Download Anna University B.Tech (Bachelor of Technology) CSE (Computer Science And Engineering) 5th Sem CS6512 Internet Programming IP Lab Manual Question Paper.

This post was last modified on 13 December 2019


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

FirstRanker.com - FirstRanker's Choice

1


--- Content provided by FirstRanker.com ---

?




--- Content provided by FirstRanker.com ---

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---




LABORATORY MANUAL

--- Content provided by FirstRanker.com ---

2




--- Content provided by FirstRanker.com ---

College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry

--- Content provided by FirstRanker.com ---

? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


--- Content provided by FirstRanker.com ---

? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and

--- Content provided by FirstRanker.com ---

ethical practices




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering

--- Content provided by FirstRanker.com ---

that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth

--- Content provided by FirstRanker.com ---

To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their

--- Content provided by FirstRanker.com ---

communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



3

PROGRAMME OUTCOMES (POs)

--- Content provided by FirstRanker.com ---

a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions

--- Content provided by FirstRanker.com ---

e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal

--- Content provided by FirstRanker.com ---

and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---




? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets

--- Content provided by FirstRanker.com ---

? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.

--- Content provided by FirstRanker.com ---

5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form

--- Content provided by FirstRanker.com ---

4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---


5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user

--- Content provided by FirstRanker.com ---

information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is

--- Content provided by FirstRanker.com ---

typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,

--- Content provided by FirstRanker.com ---

opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and

--- Content provided by FirstRanker.com ---

sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---


1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---


6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---


d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.

--- Content provided by FirstRanker.com ---

2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It

--- Content provided by FirstRanker.com ---

requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.

--- Content provided by FirstRanker.com ---

2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,

--- Content provided by FirstRanker.com ---

Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---


d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.

--- Content provided by FirstRanker.com ---

3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information

--- Content provided by FirstRanker.com ---

from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server

--- Content provided by FirstRanker.com ---

i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---



? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet

--- Content provided by FirstRanker.com ---

? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7

--- Content provided by FirstRanker.com ---

2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18

--- Content provided by FirstRanker.com ---

c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets

--- Content provided by FirstRanker.com ---

a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36

--- Content provided by FirstRanker.com ---

10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45

--- Content provided by FirstRanker.com ---

14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---


16.
Design Online Quiz like Moodle Web Site

17.

--- Content provided by FirstRanker.com ---

Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---

19.
Design and Implement a Library Management System


FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---





College of Engineering is committed to provide highly disciplined, conscientious and

--- Content provided by FirstRanker.com ---

enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels

--- Content provided by FirstRanker.com ---

? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics

--- Content provided by FirstRanker.com ---

industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





VISION

--- Content provided by FirstRanker.com ---

VISION
MISSION
MISSION

2

--- Content provided by FirstRanker.com ---


ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals

--- Content provided by FirstRanker.com ---

2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to

--- Content provided by FirstRanker.com ---

find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in

--- Content provided by FirstRanker.com ---

ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools

--- Content provided by FirstRanker.com ---

f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms

--- Content provided by FirstRanker.com ---

i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---



? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.

--- Content provided by FirstRanker.com ---

? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom

--- Content provided by FirstRanker.com ---

of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles

--- Content provided by FirstRanker.com ---

should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types

--- Content provided by FirstRanker.com ---

5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.

--- Content provided by FirstRanker.com ---

1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and

--- Content provided by FirstRanker.com ---

email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.

--- Content provided by FirstRanker.com ---

3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.

--- Content provided by FirstRanker.com ---

3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it

--- Content provided by FirstRanker.com ---

unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.

--- Content provided by FirstRanker.com ---

3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web

--- Content provided by FirstRanker.com ---

pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.

--- Content provided by FirstRanker.com ---

4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an

--- Content provided by FirstRanker.com ---

init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

handles a request

--- Content provided by FirstRanker.com ---

j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the

--- Content provided by FirstRanker.com ---

answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)

--- Content provided by FirstRanker.com ---

? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL

--- Content provided by FirstRanker.com ---

? Implement a program using AJAX, Spring, Struts and Web services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10

--- Content provided by FirstRanker.com ---

3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20

--- Content provided by FirstRanker.com ---

d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25

--- Content provided by FirstRanker.com ---

b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38

--- Content provided by FirstRanker.com ---

CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47

--- Content provided by FirstRanker.com ---

MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---


18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.

--- Content provided by FirstRanker.com ---

Design and Implement a Library Management System



10

--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.

--- Content provided by FirstRanker.com ---

2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:


FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.

FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---





College of Engineering is committed to provide highly disciplined, conscientious and

--- Content provided by FirstRanker.com ---

enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels

--- Content provided by FirstRanker.com ---

? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics

--- Content provided by FirstRanker.com ---

industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





VISION

--- Content provided by FirstRanker.com ---

VISION
MISSION
MISSION

2

--- Content provided by FirstRanker.com ---


ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals

--- Content provided by FirstRanker.com ---

2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to

--- Content provided by FirstRanker.com ---

find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in

--- Content provided by FirstRanker.com ---

ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools

--- Content provided by FirstRanker.com ---

f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms

--- Content provided by FirstRanker.com ---

i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---



? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.

--- Content provided by FirstRanker.com ---

? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom

--- Content provided by FirstRanker.com ---

of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles

--- Content provided by FirstRanker.com ---

should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types

--- Content provided by FirstRanker.com ---

5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.

--- Content provided by FirstRanker.com ---

1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and

--- Content provided by FirstRanker.com ---

email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.

--- Content provided by FirstRanker.com ---

3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.

--- Content provided by FirstRanker.com ---

3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it

--- Content provided by FirstRanker.com ---

unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.

--- Content provided by FirstRanker.com ---

3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web

--- Content provided by FirstRanker.com ---

pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.

--- Content provided by FirstRanker.com ---

4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an

--- Content provided by FirstRanker.com ---

init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

handles a request

--- Content provided by FirstRanker.com ---

j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the

--- Content provided by FirstRanker.com ---

answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)

--- Content provided by FirstRanker.com ---

? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL

--- Content provided by FirstRanker.com ---

? Implement a program using AJAX, Spring, Struts and Web services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10

--- Content provided by FirstRanker.com ---

3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20

--- Content provided by FirstRanker.com ---

d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25

--- Content provided by FirstRanker.com ---

b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38

--- Content provided by FirstRanker.com ---

CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47

--- Content provided by FirstRanker.com ---

MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---


18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.

--- Content provided by FirstRanker.com ---

Design and Implement a Library Management System



10

--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.

--- Content provided by FirstRanker.com ---

2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:



11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---


Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.

--- Content provided by FirstRanker.com ---

6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---


FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---


handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)

--- Content provided by FirstRanker.com ---

would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer

--- Content provided by FirstRanker.com ---

h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets

--- Content provided by FirstRanker.com ---

? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student

--- Content provided by FirstRanker.com ---

? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS

--- Content provided by FirstRanker.com ---

1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17

--- Content provided by FirstRanker.com ---

b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23

--- Content provided by FirstRanker.com ---

6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33

--- Content provided by FirstRanker.com ---

9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43

--- Content provided by FirstRanker.com ---

13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering

--- Content provided by FirstRanker.com ---

Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---

17.
Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---


19.
Design and Implement a Library Management System


--- Content provided by FirstRanker.com ---


10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots

--- Content provided by FirstRanker.com ---

(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.

--- Content provided by FirstRanker.com ---

5. Load the india.html page using internet explorer.

Sample output:


--- Content provided by FirstRanker.com ---


11



--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---


12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter

--- Content provided by FirstRanker.com ---

2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





13

--- Content provided by FirstRanker.com ---


Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages

--- Content provided by FirstRanker.com ---

4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:

--- Content provided by FirstRanker.com ---

Inline style sheet:




--- Content provided by FirstRanker.com ---


14

Embedded style sheet:

--- Content provided by FirstRanker.com ---





Cap.html:

--- Content provided by FirstRanker.com ---





External.html:

--- Content provided by FirstRanker.com ---


15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.

--- Content provided by FirstRanker.com ---

Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute

--- Content provided by FirstRanker.com ---

3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




17

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of

--- Content provided by FirstRanker.com ---

TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.



--- Content provided by FirstRanker.com ---

18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post

--- Content provided by FirstRanker.com ---

4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"

--- Content provided by FirstRanker.com ---

itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---


handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)

--- Content provided by FirstRanker.com ---

would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer

--- Content provided by FirstRanker.com ---

h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets

--- Content provided by FirstRanker.com ---

? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student

--- Content provided by FirstRanker.com ---

? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS

--- Content provided by FirstRanker.com ---

1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17

--- Content provided by FirstRanker.com ---

b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23

--- Content provided by FirstRanker.com ---

6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33

--- Content provided by FirstRanker.com ---

9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43

--- Content provided by FirstRanker.com ---

13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering

--- Content provided by FirstRanker.com ---

Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---

17.
Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---


19.
Design and Implement a Library Management System


--- Content provided by FirstRanker.com ---


10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots

--- Content provided by FirstRanker.com ---

(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.

--- Content provided by FirstRanker.com ---

5. Load the india.html page using internet explorer.

Sample output:


--- Content provided by FirstRanker.com ---


11



--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---


12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter

--- Content provided by FirstRanker.com ---

2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





13

--- Content provided by FirstRanker.com ---


Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages

--- Content provided by FirstRanker.com ---

4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:

--- Content provided by FirstRanker.com ---

Inline style sheet:




--- Content provided by FirstRanker.com ---


14

Embedded style sheet:

--- Content provided by FirstRanker.com ---





Cap.html:

--- Content provided by FirstRanker.com ---





External.html:

--- Content provided by FirstRanker.com ---


15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.

--- Content provided by FirstRanker.com ---

Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute

--- Content provided by FirstRanker.com ---

3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




17

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of

--- Content provided by FirstRanker.com ---

TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.



--- Content provided by FirstRanker.com ---

18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post

--- Content provided by FirstRanker.com ---

4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"

--- Content provided by FirstRanker.com ---

itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



19


--- Content provided by FirstRanker.com ---

Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP

--- Content provided by FirstRanker.com ---

2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---

Sample output:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---



FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.


FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

FirstRanker.com - FirstRanker's Choice

1


--- Content provided by FirstRanker.com ---

?




--- Content provided by FirstRanker.com ---

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---




LABORATORY MANUAL

--- Content provided by FirstRanker.com ---

2




--- Content provided by FirstRanker.com ---

College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry

--- Content provided by FirstRanker.com ---

? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


--- Content provided by FirstRanker.com ---

? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and

--- Content provided by FirstRanker.com ---

ethical practices




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering

--- Content provided by FirstRanker.com ---

that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth

--- Content provided by FirstRanker.com ---

To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their

--- Content provided by FirstRanker.com ---

communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



3

PROGRAMME OUTCOMES (POs)

--- Content provided by FirstRanker.com ---

a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions

--- Content provided by FirstRanker.com ---

e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal

--- Content provided by FirstRanker.com ---

and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---




? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets

--- Content provided by FirstRanker.com ---

? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.

--- Content provided by FirstRanker.com ---

5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form

--- Content provided by FirstRanker.com ---

4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---


5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user

--- Content provided by FirstRanker.com ---

information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is

--- Content provided by FirstRanker.com ---

typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,

--- Content provided by FirstRanker.com ---

opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and

--- Content provided by FirstRanker.com ---

sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---


1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---


6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---


d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.

--- Content provided by FirstRanker.com ---

2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It

--- Content provided by FirstRanker.com ---

requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.

--- Content provided by FirstRanker.com ---

2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,

--- Content provided by FirstRanker.com ---

Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---


d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.

--- Content provided by FirstRanker.com ---

3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information

--- Content provided by FirstRanker.com ---

from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server

--- Content provided by FirstRanker.com ---

i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---



? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet

--- Content provided by FirstRanker.com ---

? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7

--- Content provided by FirstRanker.com ---

2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18

--- Content provided by FirstRanker.com ---

c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets

--- Content provided by FirstRanker.com ---

a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36

--- Content provided by FirstRanker.com ---

10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45

--- Content provided by FirstRanker.com ---

14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---


16.
Design Online Quiz like Moodle Web Site

17.

--- Content provided by FirstRanker.com ---

Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---

19.
Design and Implement a Library Management System



--- Content provided by FirstRanker.com ---

10

Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

11




--- Content provided by FirstRanker.com ---




Result:
Thus the program of creating webpage with image mapping is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


--- Content provided by FirstRanker.com ---

12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.

--- Content provided by FirstRanker.com ---

3. Designing of Personal Web site like GoDaddy, Wedding Site




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




13

--- Content provided by FirstRanker.com ---

Expt.No.: 2 STYLE SHEETS

Aim:

To create a web page with the following

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---


1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.

--- Content provided by FirstRanker.com ---

5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

14

Embedded style sheet:


--- Content provided by FirstRanker.com ---




Cap.html:

--- Content provided by FirstRanker.com ---




External.html:

--- Content provided by FirstRanker.com ---

15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---


16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.

--- Content provided by FirstRanker.com ---

2. Designing web site validation of Registration and Feedback Queries of Web Sites.



18

--- Content provided by FirstRanker.com ---



Expt.No. 4.(a) : HTTP REQUEST

Aim:

--- Content provided by FirstRanker.com ---

To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request

--- Content provided by FirstRanker.com ---

5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request

--- Content provided by FirstRanker.com ---

Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---


Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets

--- Content provided by FirstRanker.com ---

3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:

--- Content provided by FirstRanker.com ---

F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---



20

[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---



Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server

--- Content provided by FirstRanker.com ---

6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server

--- Content provided by FirstRanker.com ---

11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection


--- Content provided by FirstRanker.com ---



Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---


22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:

--- Content provided by FirstRanker.com ---

Java
Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans

--- Content provided by FirstRanker.com ---

2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL

--- Content provided by FirstRanker.com ---

www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:
messages.length---298

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---

23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files

--- Content provided by FirstRanker.com ---

like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





24

--- Content provided by FirstRanker.com ---


Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---


To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:

Server Side
1. Import net and io packages and class

--- Content provided by FirstRanker.com ---

2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server

--- Content provided by FirstRanker.com ---

Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client

--- Content provided by FirstRanker.com ---

Hai
Hello how are you



--- Content provided by FirstRanker.com ---


FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---


handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)

--- Content provided by FirstRanker.com ---

would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer

--- Content provided by FirstRanker.com ---

h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets

--- Content provided by FirstRanker.com ---

? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student

--- Content provided by FirstRanker.com ---

? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS

--- Content provided by FirstRanker.com ---

1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17

--- Content provided by FirstRanker.com ---

b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23

--- Content provided by FirstRanker.com ---

6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33

--- Content provided by FirstRanker.com ---

9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43

--- Content provided by FirstRanker.com ---

13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering

--- Content provided by FirstRanker.com ---

Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---

17.
Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---


19.
Design and Implement a Library Management System


--- Content provided by FirstRanker.com ---


10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots

--- Content provided by FirstRanker.com ---

(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.

--- Content provided by FirstRanker.com ---

5. Load the india.html page using internet explorer.

Sample output:


--- Content provided by FirstRanker.com ---


11



--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---


12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter

--- Content provided by FirstRanker.com ---

2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





13

--- Content provided by FirstRanker.com ---


Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages

--- Content provided by FirstRanker.com ---

4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:

--- Content provided by FirstRanker.com ---

Inline style sheet:




--- Content provided by FirstRanker.com ---


14

Embedded style sheet:

--- Content provided by FirstRanker.com ---





Cap.html:

--- Content provided by FirstRanker.com ---





External.html:

--- Content provided by FirstRanker.com ---


15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.

--- Content provided by FirstRanker.com ---

Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute

--- Content provided by FirstRanker.com ---

3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




17

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of

--- Content provided by FirstRanker.com ---

TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.



--- Content provided by FirstRanker.com ---

18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post

--- Content provided by FirstRanker.com ---

4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"

--- Content provided by FirstRanker.com ---

itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



19


--- Content provided by FirstRanker.com ---

Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP

--- Content provided by FirstRanker.com ---

2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---

Sample output:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---




20

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




21

--- Content provided by FirstRanker.com ---

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server

--- Content provided by FirstRanker.com ---

5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps

--- Content provided by FirstRanker.com ---

10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---




Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---


Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---

Software requirements:
Java
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message

--- Content provided by FirstRanker.com ---

5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:

--- Content provided by FirstRanker.com ---

messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---


23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


--- Content provided by FirstRanker.com ---

Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:

Server Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string

--- Content provided by FirstRanker.com ---

Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client

--- Content provided by FirstRanker.com ---

Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server

--- Content provided by FirstRanker.com ---

Server is waiting for data received from client
Hai
Hello how are you


--- Content provided by FirstRanker.com ---




25

--- Content provided by FirstRanker.com ---

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been

--- Content provided by FirstRanker.com ---

attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---





College of Engineering is committed to provide highly disciplined, conscientious and

--- Content provided by FirstRanker.com ---

enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels

--- Content provided by FirstRanker.com ---

? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics

--- Content provided by FirstRanker.com ---

industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





VISION

--- Content provided by FirstRanker.com ---

VISION
MISSION
MISSION

2

--- Content provided by FirstRanker.com ---


ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals

--- Content provided by FirstRanker.com ---

2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to

--- Content provided by FirstRanker.com ---

find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in

--- Content provided by FirstRanker.com ---

ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools

--- Content provided by FirstRanker.com ---

f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms

--- Content provided by FirstRanker.com ---

i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---



? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.

--- Content provided by FirstRanker.com ---

? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom

--- Content provided by FirstRanker.com ---

of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles

--- Content provided by FirstRanker.com ---

should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types

--- Content provided by FirstRanker.com ---

5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.

--- Content provided by FirstRanker.com ---

1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and

--- Content provided by FirstRanker.com ---

email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.

--- Content provided by FirstRanker.com ---

3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.

--- Content provided by FirstRanker.com ---

3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it

--- Content provided by FirstRanker.com ---

unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.

--- Content provided by FirstRanker.com ---

3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web

--- Content provided by FirstRanker.com ---

pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.

--- Content provided by FirstRanker.com ---

4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an

--- Content provided by FirstRanker.com ---

init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

handles a request

--- Content provided by FirstRanker.com ---

j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the

--- Content provided by FirstRanker.com ---

answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)

--- Content provided by FirstRanker.com ---

? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL

--- Content provided by FirstRanker.com ---

? Implement a program using AJAX, Spring, Struts and Web services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10

--- Content provided by FirstRanker.com ---

3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20

--- Content provided by FirstRanker.com ---

d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25

--- Content provided by FirstRanker.com ---

b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38

--- Content provided by FirstRanker.com ---

CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47

--- Content provided by FirstRanker.com ---

MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---


18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.

--- Content provided by FirstRanker.com ---

Design and Implement a Library Management System



10

--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.

--- Content provided by FirstRanker.com ---

2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:



11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---


Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.

--- Content provided by FirstRanker.com ---

6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---





14

--- Content provided by FirstRanker.com ---


Embedded style sheet:



--- Content provided by FirstRanker.com ---



Cap.html:


--- Content provided by FirstRanker.com ---



External.html:

15

--- Content provided by FirstRanker.com ---



Caps.html:


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the website with college information using internal and external cascading style

--- Content provided by FirstRanker.com ---

sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :

--- Content provided by FirstRanker.com ---

To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.

--- Content provided by FirstRanker.com ---

2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get

--- Content provided by FirstRanker.com ---

Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---




18

--- Content provided by FirstRanker.com ---


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language

--- Content provided by FirstRanker.com ---

6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/

--- Content provided by FirstRanker.com ---

Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the http request messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method

--- Content provided by FirstRanker.com ---

4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :3
F:\IP\client>java Main


--- Content provided by FirstRanker.com ---


20

[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...

--- Content provided by FirstRanker.com ---

File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...
GET Command Received ...
Waiting for Command ...


--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server

--- Content provided by FirstRanker.com ---

2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server

--- Content provided by FirstRanker.com ---

7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server

--- Content provided by FirstRanker.com ---

12. Read the acceptance of message from server
13. Close the connection



--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---

22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---


To write a program in Java using sockets to implement the pop3

Software requirements:
Java

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax

--- Content provided by FirstRanker.com ---

mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps

--- Content provided by FirstRanker.com ---

6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.

--- Content provided by FirstRanker.com ---

2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




24

--- Content provided by FirstRanker.com ---

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet

--- Content provided by FirstRanker.com ---

3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages

--- Content provided by FirstRanker.com ---

2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai

--- Content provided by FirstRanker.com ---

Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai

--- Content provided by FirstRanker.com ---

Hello how are you




--- Content provided by FirstRanker.com ---


25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




26

--- Content provided by FirstRanker.com ---

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:

--- Content provided by FirstRanker.com ---

i. Insert a
that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter

--- Content provided by FirstRanker.com ---

values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.

--- Content provided by FirstRanker.com ---

5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish

--- Content provided by FirstRanker.com ---

7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the

--- Content provided by FirstRanker.com ---

recipients.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---



Aim:

To write a java program to create a simple chat application with datagram sockets

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---


Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port

--- Content provided by FirstRanker.com ---

4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet

--- Content provided by FirstRanker.com ---

3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button

--- Content provided by FirstRanker.com ---

2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()

--- Content provided by FirstRanker.com ---

iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans

--- Content provided by FirstRanker.com ---

1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the

--- Content provided by FirstRanker.com ---

code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After

--- Content provided by FirstRanker.com ---

compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---


.Result: Thus the program for invokes the servlet from html is written and executed successfully.
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:

FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

FirstRanker.com - FirstRanker's Choice

1


--- Content provided by FirstRanker.com ---

?




--- Content provided by FirstRanker.com ---

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---




LABORATORY MANUAL

--- Content provided by FirstRanker.com ---

2




--- Content provided by FirstRanker.com ---

College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry

--- Content provided by FirstRanker.com ---

? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


--- Content provided by FirstRanker.com ---

? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and

--- Content provided by FirstRanker.com ---

ethical practices




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering

--- Content provided by FirstRanker.com ---

that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth

--- Content provided by FirstRanker.com ---

To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their

--- Content provided by FirstRanker.com ---

communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



3

PROGRAMME OUTCOMES (POs)

--- Content provided by FirstRanker.com ---

a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions

--- Content provided by FirstRanker.com ---

e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal

--- Content provided by FirstRanker.com ---

and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---




? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets

--- Content provided by FirstRanker.com ---

? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.

--- Content provided by FirstRanker.com ---

5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form

--- Content provided by FirstRanker.com ---

4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---


5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user

--- Content provided by FirstRanker.com ---

information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is

--- Content provided by FirstRanker.com ---

typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,

--- Content provided by FirstRanker.com ---

opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and

--- Content provided by FirstRanker.com ---

sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---


1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---


6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---


d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.

--- Content provided by FirstRanker.com ---

2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It

--- Content provided by FirstRanker.com ---

requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.

--- Content provided by FirstRanker.com ---

2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,

--- Content provided by FirstRanker.com ---

Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---


d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.

--- Content provided by FirstRanker.com ---

3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information

--- Content provided by FirstRanker.com ---

from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server

--- Content provided by FirstRanker.com ---

i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---



? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet

--- Content provided by FirstRanker.com ---

? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7

--- Content provided by FirstRanker.com ---

2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18

--- Content provided by FirstRanker.com ---

c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets

--- Content provided by FirstRanker.com ---

a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36

--- Content provided by FirstRanker.com ---

10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45

--- Content provided by FirstRanker.com ---

14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---


16.
Design Online Quiz like Moodle Web Site

17.

--- Content provided by FirstRanker.com ---

Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---

19.
Design and Implement a Library Management System



--- Content provided by FirstRanker.com ---

10

Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

11




--- Content provided by FirstRanker.com ---




Result:
Thus the program of creating webpage with image mapping is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


--- Content provided by FirstRanker.com ---

12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.

--- Content provided by FirstRanker.com ---

3. Designing of Personal Web site like GoDaddy, Wedding Site




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




13

--- Content provided by FirstRanker.com ---

Expt.No.: 2 STYLE SHEETS

Aim:

To create a web page with the following

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---


1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.

--- Content provided by FirstRanker.com ---

5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

14

Embedded style sheet:


--- Content provided by FirstRanker.com ---




Cap.html:

--- Content provided by FirstRanker.com ---




External.html:

--- Content provided by FirstRanker.com ---

15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---


16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.

--- Content provided by FirstRanker.com ---

2. Designing web site validation of Registration and Feedback Queries of Web Sites.



18

--- Content provided by FirstRanker.com ---



Expt.No. 4.(a) : HTTP REQUEST

Aim:

--- Content provided by FirstRanker.com ---

To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request

--- Content provided by FirstRanker.com ---

5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request

--- Content provided by FirstRanker.com ---

Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---


Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets

--- Content provided by FirstRanker.com ---

3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:

--- Content provided by FirstRanker.com ---

F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---



20

[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---



Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server

--- Content provided by FirstRanker.com ---

6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server

--- Content provided by FirstRanker.com ---

11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection


--- Content provided by FirstRanker.com ---



Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---


22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:

--- Content provided by FirstRanker.com ---

Java
Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans

--- Content provided by FirstRanker.com ---

2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL

--- Content provided by FirstRanker.com ---

www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:
messages.length---298

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---

23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files

--- Content provided by FirstRanker.com ---

like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





24

--- Content provided by FirstRanker.com ---


Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---


To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:

Server Side
1. Import net and io packages and class

--- Content provided by FirstRanker.com ---

2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server

--- Content provided by FirstRanker.com ---

Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client

--- Content provided by FirstRanker.com ---

Hai
Hello how are you



--- Content provided by FirstRanker.com ---



25

Result:

--- Content provided by FirstRanker.com ---

Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





26

--- Content provided by FirstRanker.com ---


Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the

--- Content provided by FirstRanker.com ---

parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).

--- Content provided by FirstRanker.com ---

5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears

--- Content provided by FirstRanker.com ---

4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?

--- Content provided by FirstRanker.com ---

checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

--- Content provided by FirstRanker.com ---

27

Sample output:


--- Content provided by FirstRanker.com ---




.Result: Thus the program for invokes the servlet from html is written and executed successfully.

--- Content provided by FirstRanker.com ---

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:

--- Content provided by FirstRanker.com ---

To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.

--- Content provided by FirstRanker.com ---

iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet

--- Content provided by FirstRanker.com ---

3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




Sample output:

--- Content provided by FirstRanker.com ---


29



--- Content provided by FirstRanker.com ---

Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke

--- Content provided by FirstRanker.com ---

servlets from HTML forms and applets (CO5) has been attained.

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.

--- Content provided by FirstRanker.com ---

2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





30

--- Content provided by FirstRanker.com ---


Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database

--- Content provided by FirstRanker.com ---

2. Open the database connection
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:

--- Content provided by FirstRanker.com ---


FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---


handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)

--- Content provided by FirstRanker.com ---

would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer

--- Content provided by FirstRanker.com ---

h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets

--- Content provided by FirstRanker.com ---

? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student

--- Content provided by FirstRanker.com ---

? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS

--- Content provided by FirstRanker.com ---

1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17

--- Content provided by FirstRanker.com ---

b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23

--- Content provided by FirstRanker.com ---

6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33

--- Content provided by FirstRanker.com ---

9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43

--- Content provided by FirstRanker.com ---

13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering

--- Content provided by FirstRanker.com ---

Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---

17.
Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---


19.
Design and Implement a Library Management System


--- Content provided by FirstRanker.com ---


10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots

--- Content provided by FirstRanker.com ---

(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.

--- Content provided by FirstRanker.com ---

5. Load the india.html page using internet explorer.

Sample output:


--- Content provided by FirstRanker.com ---


11



--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---


12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter

--- Content provided by FirstRanker.com ---

2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





13

--- Content provided by FirstRanker.com ---


Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages

--- Content provided by FirstRanker.com ---

4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:

--- Content provided by FirstRanker.com ---

Inline style sheet:




--- Content provided by FirstRanker.com ---


14

Embedded style sheet:

--- Content provided by FirstRanker.com ---





Cap.html:

--- Content provided by FirstRanker.com ---





External.html:

--- Content provided by FirstRanker.com ---


15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.

--- Content provided by FirstRanker.com ---

Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute

--- Content provided by FirstRanker.com ---

3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




17

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of

--- Content provided by FirstRanker.com ---

TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.



--- Content provided by FirstRanker.com ---

18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post

--- Content provided by FirstRanker.com ---

4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"

--- Content provided by FirstRanker.com ---

itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



19


--- Content provided by FirstRanker.com ---

Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP

--- Content provided by FirstRanker.com ---

2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---

Sample output:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---




20

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




21

--- Content provided by FirstRanker.com ---

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server

--- Content provided by FirstRanker.com ---

5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps

--- Content provided by FirstRanker.com ---

10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---




Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---


Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---

Software requirements:
Java
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message

--- Content provided by FirstRanker.com ---

5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:

--- Content provided by FirstRanker.com ---

messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---


23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


--- Content provided by FirstRanker.com ---

Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:

Server Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string

--- Content provided by FirstRanker.com ---

Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client

--- Content provided by FirstRanker.com ---

Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server

--- Content provided by FirstRanker.com ---

Server is waiting for data received from client
Hai
Hello how are you


--- Content provided by FirstRanker.com ---




25

--- Content provided by FirstRanker.com ---

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been

--- Content provided by FirstRanker.com ---

attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:

--- Content provided by FirstRanker.com ---

To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet

--- Content provided by FirstRanker.com ---

iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).

--- Content provided by FirstRanker.com ---

4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).

--- Content provided by FirstRanker.com ---

3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?

--- Content provided by FirstRanker.com ---

, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

--- Content provided by FirstRanker.com ---


27

Sample output:

--- Content provided by FirstRanker.com ---





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

--- Content provided by FirstRanker.com ---


28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.

--- Content provided by FirstRanker.com ---

ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().

--- Content provided by FirstRanker.com ---

2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---



29


--- Content provided by FirstRanker.com ---


Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC

--- Content provided by FirstRanker.com ---

1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.

--- Content provided by FirstRanker.com ---

Sample output:


31

--- Content provided by FirstRanker.com ---




Result:
Thus the online application of servlet using database was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and Implement a Library Management System.
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---


handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)

--- Content provided by FirstRanker.com ---

would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer

--- Content provided by FirstRanker.com ---

h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets

--- Content provided by FirstRanker.com ---

? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student

--- Content provided by FirstRanker.com ---

? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS

--- Content provided by FirstRanker.com ---

1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17

--- Content provided by FirstRanker.com ---

b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23

--- Content provided by FirstRanker.com ---

6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33

--- Content provided by FirstRanker.com ---

9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43

--- Content provided by FirstRanker.com ---

13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering

--- Content provided by FirstRanker.com ---

Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---

17.
Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---


19.
Design and Implement a Library Management System


--- Content provided by FirstRanker.com ---


10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots

--- Content provided by FirstRanker.com ---

(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.

--- Content provided by FirstRanker.com ---

5. Load the india.html page using internet explorer.

Sample output:


--- Content provided by FirstRanker.com ---


11



--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---


12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter

--- Content provided by FirstRanker.com ---

2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





13

--- Content provided by FirstRanker.com ---


Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages

--- Content provided by FirstRanker.com ---

4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:

--- Content provided by FirstRanker.com ---

Inline style sheet:




--- Content provided by FirstRanker.com ---


14

Embedded style sheet:

--- Content provided by FirstRanker.com ---





Cap.html:

--- Content provided by FirstRanker.com ---





External.html:

--- Content provided by FirstRanker.com ---


15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.

--- Content provided by FirstRanker.com ---

Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute

--- Content provided by FirstRanker.com ---

3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




17

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of

--- Content provided by FirstRanker.com ---

TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.



--- Content provided by FirstRanker.com ---

18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post

--- Content provided by FirstRanker.com ---

4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"

--- Content provided by FirstRanker.com ---

itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



19


--- Content provided by FirstRanker.com ---

Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP

--- Content provided by FirstRanker.com ---

2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---

Sample output:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---




20

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




21

--- Content provided by FirstRanker.com ---

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server

--- Content provided by FirstRanker.com ---

5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps

--- Content provided by FirstRanker.com ---

10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---




Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---


Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---

Software requirements:
Java
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message

--- Content provided by FirstRanker.com ---

5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:

--- Content provided by FirstRanker.com ---

messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---


23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


--- Content provided by FirstRanker.com ---

Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:

Server Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string

--- Content provided by FirstRanker.com ---

Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client

--- Content provided by FirstRanker.com ---

Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server

--- Content provided by FirstRanker.com ---

Server is waiting for data received from client
Hai
Hello how are you


--- Content provided by FirstRanker.com ---




25

--- Content provided by FirstRanker.com ---

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been

--- Content provided by FirstRanker.com ---

attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:

--- Content provided by FirstRanker.com ---

To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet

--- Content provided by FirstRanker.com ---

iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).

--- Content provided by FirstRanker.com ---

4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).

--- Content provided by FirstRanker.com ---

3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?

--- Content provided by FirstRanker.com ---

, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

--- Content provided by FirstRanker.com ---


27

Sample output:

--- Content provided by FirstRanker.com ---





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

--- Content provided by FirstRanker.com ---


28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.

--- Content provided by FirstRanker.com ---

ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().

--- Content provided by FirstRanker.com ---

2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---



29


--- Content provided by FirstRanker.com ---


Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC

--- Content provided by FirstRanker.com ---

1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.

--- Content provided by FirstRanker.com ---

Sample output:


31

--- Content provided by FirstRanker.com ---




Result:
Thus the online application of servlet using database was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.

--- Content provided by FirstRanker.com ---

3. Design and Implement an Online Quiz




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the

--- Content provided by FirstRanker.com ---

recipients.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---



Aim:

To write a java program to create a simple chat application with datagram sockets

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---


Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port

--- Content provided by FirstRanker.com ---

4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet

--- Content provided by FirstRanker.com ---

3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button

--- Content provided by FirstRanker.com ---

2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()

--- Content provided by FirstRanker.com ---

iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans

--- Content provided by FirstRanker.com ---

1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the

--- Content provided by FirstRanker.com ---

code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After

--- Content provided by FirstRanker.com ---

compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---


.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:

--- Content provided by FirstRanker.com ---

i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.

--- Content provided by FirstRanker.com ---

v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.

--- Content provided by FirstRanker.com ---

5. Click the button on the applet window in order to invoke the servlet program.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Sample output:


29

--- Content provided by FirstRanker.com ---




Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.

--- Content provided by FirstRanker.com ---

7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement

--- Content provided by FirstRanker.com ---

4. Process the results
5. Close the connection to the database.
Sample output:


--- Content provided by FirstRanker.com ---

31




--- Content provided by FirstRanker.com ---

Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---


2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---

Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.

--- Content provided by FirstRanker.com ---

3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.

--- Content provided by FirstRanker.com ---

6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results

--- Content provided by FirstRanker.com ---

5. Close the connection to the database.
Sample output:


31

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

33

Expt.No.8: LOCKING SERVER ITSELF

Aim:

--- Content provided by FirstRanker.com ---

To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to

--- Content provided by FirstRanker.com ---

simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



34

Sample output:

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for

--- Content provided by FirstRanker.com ---

the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---





College of Engineering is committed to provide highly disciplined, conscientious and

--- Content provided by FirstRanker.com ---

enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels

--- Content provided by FirstRanker.com ---

? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics

--- Content provided by FirstRanker.com ---

industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





VISION

--- Content provided by FirstRanker.com ---

VISION
MISSION
MISSION

2

--- Content provided by FirstRanker.com ---


ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals

--- Content provided by FirstRanker.com ---

2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to

--- Content provided by FirstRanker.com ---

find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in

--- Content provided by FirstRanker.com ---

ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools

--- Content provided by FirstRanker.com ---

f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms

--- Content provided by FirstRanker.com ---

i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---



? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.

--- Content provided by FirstRanker.com ---

? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom

--- Content provided by FirstRanker.com ---

of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles

--- Content provided by FirstRanker.com ---

should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types

--- Content provided by FirstRanker.com ---

5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.

--- Content provided by FirstRanker.com ---

1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and

--- Content provided by FirstRanker.com ---

email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.

--- Content provided by FirstRanker.com ---

3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.

--- Content provided by FirstRanker.com ---

3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it

--- Content provided by FirstRanker.com ---

unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.

--- Content provided by FirstRanker.com ---

3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web

--- Content provided by FirstRanker.com ---

pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.

--- Content provided by FirstRanker.com ---

4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an

--- Content provided by FirstRanker.com ---

init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

handles a request

--- Content provided by FirstRanker.com ---

j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the

--- Content provided by FirstRanker.com ---

answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)

--- Content provided by FirstRanker.com ---

? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL

--- Content provided by FirstRanker.com ---

? Implement a program using AJAX, Spring, Struts and Web services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10

--- Content provided by FirstRanker.com ---

3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20

--- Content provided by FirstRanker.com ---

d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25

--- Content provided by FirstRanker.com ---

b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38

--- Content provided by FirstRanker.com ---

CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47

--- Content provided by FirstRanker.com ---

MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---


18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.

--- Content provided by FirstRanker.com ---

Design and Implement a Library Management System



10

--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.

--- Content provided by FirstRanker.com ---

2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:



11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---


Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.

--- Content provided by FirstRanker.com ---

6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---





14

--- Content provided by FirstRanker.com ---


Embedded style sheet:



--- Content provided by FirstRanker.com ---



Cap.html:


--- Content provided by FirstRanker.com ---



External.html:

15

--- Content provided by FirstRanker.com ---



Caps.html:


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the website with college information using internal and external cascading style

--- Content provided by FirstRanker.com ---

sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :

--- Content provided by FirstRanker.com ---

To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.

--- Content provided by FirstRanker.com ---

2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get

--- Content provided by FirstRanker.com ---

Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---




18

--- Content provided by FirstRanker.com ---


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language

--- Content provided by FirstRanker.com ---

6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/

--- Content provided by FirstRanker.com ---

Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the http request messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method

--- Content provided by FirstRanker.com ---

4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :3
F:\IP\client>java Main


--- Content provided by FirstRanker.com ---


20

[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...

--- Content provided by FirstRanker.com ---

File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...
GET Command Received ...
Waiting for Command ...


--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server

--- Content provided by FirstRanker.com ---

2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server

--- Content provided by FirstRanker.com ---

7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server

--- Content provided by FirstRanker.com ---

12. Read the acceptance of message from server
13. Close the connection



--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---

22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---


To write a program in Java using sockets to implement the pop3

Software requirements:
Java

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax

--- Content provided by FirstRanker.com ---

mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps

--- Content provided by FirstRanker.com ---

6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.

--- Content provided by FirstRanker.com ---

2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




24

--- Content provided by FirstRanker.com ---

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet

--- Content provided by FirstRanker.com ---

3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages

--- Content provided by FirstRanker.com ---

2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai

--- Content provided by FirstRanker.com ---

Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai

--- Content provided by FirstRanker.com ---

Hello how are you




--- Content provided by FirstRanker.com ---


25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




26

--- Content provided by FirstRanker.com ---

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:

--- Content provided by FirstRanker.com ---

i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter

--- Content provided by FirstRanker.com ---

values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.

--- Content provided by FirstRanker.com ---

5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish

--- Content provided by FirstRanker.com ---

7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---



.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---


Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().

--- Content provided by FirstRanker.com ---

iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.

--- Content provided by FirstRanker.com ---

4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Sample output:


--- Content provided by FirstRanker.com ---

29



Result:

--- Content provided by FirstRanker.com ---

Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---


Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




30

--- Content provided by FirstRanker.com ---

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.

--- Content provided by FirstRanker.com ---

6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection

--- Content provided by FirstRanker.com ---

3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:

--- Content provided by FirstRanker.com ---


31



--- Content provided by FirstRanker.com ---


Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database

--- Content provided by FirstRanker.com ---

for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:
1. Design and Implement a Library Management System.

--- Content provided by FirstRanker.com ---

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---


Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself

--- Content provided by FirstRanker.com ---

and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address

--- Content provided by FirstRanker.com ---

Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





34

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---


Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



35

Expt.No.: 9 SESSION TRACKING IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---


Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the

--- Content provided by FirstRanker.com ---

recipients.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---



Aim:

To write a java program to create a simple chat application with datagram sockets

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---


Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port

--- Content provided by FirstRanker.com ---

4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet

--- Content provided by FirstRanker.com ---

3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button

--- Content provided by FirstRanker.com ---

2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()

--- Content provided by FirstRanker.com ---

iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans

--- Content provided by FirstRanker.com ---

1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the

--- Content provided by FirstRanker.com ---

code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After

--- Content provided by FirstRanker.com ---

compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---


.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:

--- Content provided by FirstRanker.com ---

i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.

--- Content provided by FirstRanker.com ---

v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.

--- Content provided by FirstRanker.com ---

5. Click the button on the applet window in order to invoke the servlet program.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Sample output:


29

--- Content provided by FirstRanker.com ---




Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.

--- Content provided by FirstRanker.com ---

7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement

--- Content provided by FirstRanker.com ---

4. Process the results
5. Close the connection to the database.
Sample output:


--- Content provided by FirstRanker.com ---

31




--- Content provided by FirstRanker.com ---

Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---


2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---

Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.

--- Content provided by FirstRanker.com ---

3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.

--- Content provided by FirstRanker.com ---

6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




34

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---

Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture

--- Content provided by FirstRanker.com ---

using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15

--- Content provided by FirstRanker.com ---

minutes and so on.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results

--- Content provided by FirstRanker.com ---

5. Close the connection to the database.
Sample output:


31

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

33

Expt.No.8: LOCKING SERVER ITSELF

Aim:

--- Content provided by FirstRanker.com ---

To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to

--- Content provided by FirstRanker.com ---

simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



34

Sample output:

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for

--- Content provided by FirstRanker.com ---

the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:

--- Content provided by FirstRanker.com ---

Thus a servlet program using HTTP Servlet is created and executed successfully.

36

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).

--- Content provided by FirstRanker.com ---

2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---


Sample output:


FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---





College of Engineering is committed to provide highly disciplined, conscientious and

--- Content provided by FirstRanker.com ---

enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels

--- Content provided by FirstRanker.com ---

? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics

--- Content provided by FirstRanker.com ---

industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





VISION

--- Content provided by FirstRanker.com ---

VISION
MISSION
MISSION

2

--- Content provided by FirstRanker.com ---


ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals

--- Content provided by FirstRanker.com ---

2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to

--- Content provided by FirstRanker.com ---

find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in

--- Content provided by FirstRanker.com ---

ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools

--- Content provided by FirstRanker.com ---

f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms

--- Content provided by FirstRanker.com ---

i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---



? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.

--- Content provided by FirstRanker.com ---

? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom

--- Content provided by FirstRanker.com ---

of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles

--- Content provided by FirstRanker.com ---

should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types

--- Content provided by FirstRanker.com ---

5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.

--- Content provided by FirstRanker.com ---

1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and

--- Content provided by FirstRanker.com ---

email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.

--- Content provided by FirstRanker.com ---

3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.

--- Content provided by FirstRanker.com ---

3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it

--- Content provided by FirstRanker.com ---

unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.

--- Content provided by FirstRanker.com ---

3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web

--- Content provided by FirstRanker.com ---

pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.

--- Content provided by FirstRanker.com ---

4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an

--- Content provided by FirstRanker.com ---

init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

handles a request

--- Content provided by FirstRanker.com ---

j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the

--- Content provided by FirstRanker.com ---

answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)

--- Content provided by FirstRanker.com ---

? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL

--- Content provided by FirstRanker.com ---

? Implement a program using AJAX, Spring, Struts and Web services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10

--- Content provided by FirstRanker.com ---

3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20

--- Content provided by FirstRanker.com ---

d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25

--- Content provided by FirstRanker.com ---

b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38

--- Content provided by FirstRanker.com ---

CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47

--- Content provided by FirstRanker.com ---

MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---


18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.

--- Content provided by FirstRanker.com ---

Design and Implement a Library Management System



10

--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.

--- Content provided by FirstRanker.com ---

2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:



11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---


Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.

--- Content provided by FirstRanker.com ---

6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---





14

--- Content provided by FirstRanker.com ---


Embedded style sheet:



--- Content provided by FirstRanker.com ---



Cap.html:


--- Content provided by FirstRanker.com ---



External.html:

15

--- Content provided by FirstRanker.com ---



Caps.html:


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the website with college information using internal and external cascading style

--- Content provided by FirstRanker.com ---

sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :

--- Content provided by FirstRanker.com ---

To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.

--- Content provided by FirstRanker.com ---

2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get

--- Content provided by FirstRanker.com ---

Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---




18

--- Content provided by FirstRanker.com ---


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language

--- Content provided by FirstRanker.com ---

6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/

--- Content provided by FirstRanker.com ---

Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the http request messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method

--- Content provided by FirstRanker.com ---

4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :3
F:\IP\client>java Main


--- Content provided by FirstRanker.com ---


20

[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...

--- Content provided by FirstRanker.com ---

File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...
GET Command Received ...
Waiting for Command ...


--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server

--- Content provided by FirstRanker.com ---

2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server

--- Content provided by FirstRanker.com ---

7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server

--- Content provided by FirstRanker.com ---

12. Read the acceptance of message from server
13. Close the connection



--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---

22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---


To write a program in Java using sockets to implement the pop3

Software requirements:
Java

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax

--- Content provided by FirstRanker.com ---

mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps

--- Content provided by FirstRanker.com ---

6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.

--- Content provided by FirstRanker.com ---

2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




24

--- Content provided by FirstRanker.com ---

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet

--- Content provided by FirstRanker.com ---

3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages

--- Content provided by FirstRanker.com ---

2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai

--- Content provided by FirstRanker.com ---

Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai

--- Content provided by FirstRanker.com ---

Hello how are you




--- Content provided by FirstRanker.com ---


25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




26

--- Content provided by FirstRanker.com ---

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:

--- Content provided by FirstRanker.com ---

i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter

--- Content provided by FirstRanker.com ---

values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.

--- Content provided by FirstRanker.com ---

5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish

--- Content provided by FirstRanker.com ---

7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---



.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---


Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().

--- Content provided by FirstRanker.com ---

iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.

--- Content provided by FirstRanker.com ---

4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Sample output:


--- Content provided by FirstRanker.com ---

29



Result:

--- Content provided by FirstRanker.com ---

Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---


Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




30

--- Content provided by FirstRanker.com ---

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.

--- Content provided by FirstRanker.com ---

6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection

--- Content provided by FirstRanker.com ---

3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:

--- Content provided by FirstRanker.com ---


31



--- Content provided by FirstRanker.com ---


Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database

--- Content provided by FirstRanker.com ---

for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:
1. Design and Implement a Library Management System.

--- Content provided by FirstRanker.com ---

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---


Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself

--- Content provided by FirstRanker.com ---

and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address

--- Content provided by FirstRanker.com ---

Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





34

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---


Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



35

Expt.No.: 9 SESSION TRACKING IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---


Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





37

--- Content provided by FirstRanker.com ---


Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:

--- Content provided by FirstRanker.com ---



38


--- Content provided by FirstRanker.com ---




Result:
Thus the sessions servlet and cookie servlet was executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results

--- Content provided by FirstRanker.com ---

5. Close the connection to the database.
Sample output:


31

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

33

Expt.No.8: LOCKING SERVER ITSELF

Aim:

--- Content provided by FirstRanker.com ---

To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to

--- Content provided by FirstRanker.com ---

simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



34

Sample output:

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for

--- Content provided by FirstRanker.com ---

the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:

--- Content provided by FirstRanker.com ---

Thus a servlet program using HTTP Servlet is created and executed successfully.

36

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).

--- Content provided by FirstRanker.com ---

2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

38




--- Content provided by FirstRanker.com ---


Result:
Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page

--- Content provided by FirstRanker.com ---

ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition

--- Content provided by FirstRanker.com ---

ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet

--- Content provided by FirstRanker.com ---

iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.

--- Content provided by FirstRanker.com ---

Password: admin.

FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results

--- Content provided by FirstRanker.com ---

5. Close the connection to the database.
Sample output:


31

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

33

Expt.No.8: LOCKING SERVER ITSELF

Aim:

--- Content provided by FirstRanker.com ---

To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to

--- Content provided by FirstRanker.com ---

simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



34

Sample output:

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for

--- Content provided by FirstRanker.com ---

the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:

--- Content provided by FirstRanker.com ---

Thus a servlet program using HTTP Servlet is created and executed successfully.

36

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).

--- Content provided by FirstRanker.com ---

2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

38




--- Content provided by FirstRanker.com ---


Result:
Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page

--- Content provided by FirstRanker.com ---

ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition

--- Content provided by FirstRanker.com ---

ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet

--- Content provided by FirstRanker.com ---

iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.

--- Content provided by FirstRanker.com ---

Password: admin.


40

--- Content provided by FirstRanker.com ---


Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the

--- Content provided by FirstRanker.com ---

recipients.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---



Aim:

To write a java program to create a simple chat application with datagram sockets

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---


Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port

--- Content provided by FirstRanker.com ---

4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet

--- Content provided by FirstRanker.com ---

3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button

--- Content provided by FirstRanker.com ---

2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()

--- Content provided by FirstRanker.com ---

iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans

--- Content provided by FirstRanker.com ---

1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the

--- Content provided by FirstRanker.com ---

code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After

--- Content provided by FirstRanker.com ---

compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---


.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:

--- Content provided by FirstRanker.com ---

i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.

--- Content provided by FirstRanker.com ---

v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.

--- Content provided by FirstRanker.com ---

5. Click the button on the applet window in order to invoke the servlet program.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Sample output:


29

--- Content provided by FirstRanker.com ---




Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.

--- Content provided by FirstRanker.com ---

7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement

--- Content provided by FirstRanker.com ---

4. Process the results
5. Close the connection to the database.
Sample output:


--- Content provided by FirstRanker.com ---

31




--- Content provided by FirstRanker.com ---

Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---


2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---

Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.

--- Content provided by FirstRanker.com ---

3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.

--- Content provided by FirstRanker.com ---

6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




34

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---

Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture

--- Content provided by FirstRanker.com ---

using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15

--- Content provided by FirstRanker.com ---

minutes and so on.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




37

--- Content provided by FirstRanker.com ---

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:


--- Content provided by FirstRanker.com ---


38



--- Content provided by FirstRanker.com ---



Result:
Thus the sessions servlet and cookie servlet was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---


Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages

--- Content provided by FirstRanker.com ---

i. Creating a Login Page
ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation

--- Content provided by FirstRanker.com ---

i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page

--- Content provided by FirstRanker.com ---

ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure

--- Content provided by FirstRanker.com ---

E-mail: admin@yahoo.co.in.
Password: admin.


40

--- Content provided by FirstRanker.com ---



Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting

--- Content provided by FirstRanker.com ---

3. Displaying of E-Books




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

41

Expt.No.12 SPRING FRAMEWORK

Aim:

--- Content provided by FirstRanker.com ---

To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.

--- Content provided by FirstRanker.com ---

4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

--- Content provided by FirstRanker.com ---

Sample output:
Login page
User Name:
GEETHA

--- Content provided by FirstRanker.com ---

password:
*****

Login

--- Content provided by FirstRanker.com ---


New User?Register

Hello World! from main page

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the spring application was executed successfully.
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results

--- Content provided by FirstRanker.com ---

5. Close the connection to the database.
Sample output:


31

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

33

Expt.No.8: LOCKING SERVER ITSELF

Aim:

--- Content provided by FirstRanker.com ---

To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to

--- Content provided by FirstRanker.com ---

simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



34

Sample output:

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for

--- Content provided by FirstRanker.com ---

the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:

--- Content provided by FirstRanker.com ---

Thus a servlet program using HTTP Servlet is created and executed successfully.

36

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).

--- Content provided by FirstRanker.com ---

2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

38




--- Content provided by FirstRanker.com ---


Result:
Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page

--- Content provided by FirstRanker.com ---

ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition

--- Content provided by FirstRanker.com ---

ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet

--- Content provided by FirstRanker.com ---

iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.

--- Content provided by FirstRanker.com ---

Password: admin.


40

--- Content provided by FirstRanker.com ---


Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





41

--- Content provided by FirstRanker.com ---


Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.

--- Content provided by FirstRanker.com ---

5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:

--- Content provided by FirstRanker.com ---

Login page
User Name:
GEETHA

password:

--- Content provided by FirstRanker.com ---

*****

Login


--- Content provided by FirstRanker.com ---

New User?Register

Hello World! from main page


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the spring application was executed successfully.

42

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

Applications:
1. Data access in Spring Framework.

--- Content provided by FirstRanker.com ---

2. ERP
3. Spring Boot



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the

--- Content provided by FirstRanker.com ---

recipients.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---



Aim:

To write a java program to create a simple chat application with datagram sockets

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---


Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port

--- Content provided by FirstRanker.com ---

4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet

--- Content provided by FirstRanker.com ---

3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button

--- Content provided by FirstRanker.com ---

2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()

--- Content provided by FirstRanker.com ---

iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans

--- Content provided by FirstRanker.com ---

1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the

--- Content provided by FirstRanker.com ---

code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After

--- Content provided by FirstRanker.com ---

compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---


.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:

--- Content provided by FirstRanker.com ---

i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.

--- Content provided by FirstRanker.com ---

v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.

--- Content provided by FirstRanker.com ---

5. Click the button on the applet window in order to invoke the servlet program.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Sample output:


29

--- Content provided by FirstRanker.com ---




Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.

--- Content provided by FirstRanker.com ---

7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement

--- Content provided by FirstRanker.com ---

4. Process the results
5. Close the connection to the database.
Sample output:


--- Content provided by FirstRanker.com ---

31




--- Content provided by FirstRanker.com ---

Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---


2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---

Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.

--- Content provided by FirstRanker.com ---

3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.

--- Content provided by FirstRanker.com ---

6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




34

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---

Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture

--- Content provided by FirstRanker.com ---

using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15

--- Content provided by FirstRanker.com ---

minutes and so on.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




37

--- Content provided by FirstRanker.com ---

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:


--- Content provided by FirstRanker.com ---


38



--- Content provided by FirstRanker.com ---



Result:
Thus the sessions servlet and cookie servlet was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---


Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages

--- Content provided by FirstRanker.com ---

i. Creating a Login Page
ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation

--- Content provided by FirstRanker.com ---

i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page

--- Content provided by FirstRanker.com ---

ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure

--- Content provided by FirstRanker.com ---

E-mail: admin@yahoo.co.in.
Password: admin.


40

--- Content provided by FirstRanker.com ---



Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting

--- Content provided by FirstRanker.com ---

3. Displaying of E-Books




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

41

Expt.No.12 SPRING FRAMEWORK

Aim:

--- Content provided by FirstRanker.com ---

To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.

--- Content provided by FirstRanker.com ---

4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

--- Content provided by FirstRanker.com ---

Sample output:
Login page
User Name:
GEETHA

--- Content provided by FirstRanker.com ---

password:
*****

Login

--- Content provided by FirstRanker.com ---


New User?Register

Hello World! from main page

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the spring application was executed successfully.

42

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Data access in Spring Framework.
2. ERP
3. Spring Boot


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

43

Expt.No. 13: PROGRAM USING AJAX

Aim:

--- Content provided by FirstRanker.com ---

To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.

--- Content provided by FirstRanker.com ---

5. Display the contents of requested file.

Sample output:


--- Content provided by FirstRanker.com ---




FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the

--- Content provided by FirstRanker.com ---

recipients.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---



Aim:

To write a java program to create a simple chat application with datagram sockets

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---


Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port

--- Content provided by FirstRanker.com ---

4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet

--- Content provided by FirstRanker.com ---

3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button

--- Content provided by FirstRanker.com ---

2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()

--- Content provided by FirstRanker.com ---

iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans

--- Content provided by FirstRanker.com ---

1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the

--- Content provided by FirstRanker.com ---

code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After

--- Content provided by FirstRanker.com ---

compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---


.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:

--- Content provided by FirstRanker.com ---

i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.

--- Content provided by FirstRanker.com ---

v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.

--- Content provided by FirstRanker.com ---

5. Click the button on the applet window in order to invoke the servlet program.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Sample output:


29

--- Content provided by FirstRanker.com ---




Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.

--- Content provided by FirstRanker.com ---

7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement

--- Content provided by FirstRanker.com ---

4. Process the results
5. Close the connection to the database.
Sample output:


--- Content provided by FirstRanker.com ---

31




--- Content provided by FirstRanker.com ---

Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---


2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---

Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.

--- Content provided by FirstRanker.com ---

3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.

--- Content provided by FirstRanker.com ---

6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




34

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---

Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture

--- Content provided by FirstRanker.com ---

using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15

--- Content provided by FirstRanker.com ---

minutes and so on.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




37

--- Content provided by FirstRanker.com ---

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:


--- Content provided by FirstRanker.com ---


38



--- Content provided by FirstRanker.com ---



Result:
Thus the sessions servlet and cookie servlet was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---


Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages

--- Content provided by FirstRanker.com ---

i. Creating a Login Page
ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation

--- Content provided by FirstRanker.com ---

i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page

--- Content provided by FirstRanker.com ---

ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure

--- Content provided by FirstRanker.com ---

E-mail: admin@yahoo.co.in.
Password: admin.


40

--- Content provided by FirstRanker.com ---



Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting

--- Content provided by FirstRanker.com ---

3. Displaying of E-Books




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

41

Expt.No.12 SPRING FRAMEWORK

Aim:

--- Content provided by FirstRanker.com ---

To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.

--- Content provided by FirstRanker.com ---

4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

--- Content provided by FirstRanker.com ---

Sample output:
Login page
User Name:
GEETHA

--- Content provided by FirstRanker.com ---

password:
*****

Login

--- Content provided by FirstRanker.com ---


New User?Register

Hello World! from main page

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the spring application was executed successfully.

42

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Data access in Spring Framework.
2. ERP
3. Spring Boot


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

43

Expt.No. 13: PROGRAM USING AJAX

Aim:

--- Content provided by FirstRanker.com ---

To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.

--- Content provided by FirstRanker.com ---

5. Display the contents of requested file.

Sample output:


--- Content provided by FirstRanker.com ---





44

--- Content provided by FirstRanker.com ---


Result:
Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results

--- Content provided by FirstRanker.com ---

5. Close the connection to the database.
Sample output:


31

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

33

Expt.No.8: LOCKING SERVER ITSELF

Aim:

--- Content provided by FirstRanker.com ---

To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to

--- Content provided by FirstRanker.com ---

simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



34

Sample output:

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for

--- Content provided by FirstRanker.com ---

the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:

--- Content provided by FirstRanker.com ---

Thus a servlet program using HTTP Servlet is created and executed successfully.

36

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).

--- Content provided by FirstRanker.com ---

2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

38




--- Content provided by FirstRanker.com ---


Result:
Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page

--- Content provided by FirstRanker.com ---

ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition

--- Content provided by FirstRanker.com ---

ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet

--- Content provided by FirstRanker.com ---

iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.

--- Content provided by FirstRanker.com ---

Password: admin.


40

--- Content provided by FirstRanker.com ---


Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





41

--- Content provided by FirstRanker.com ---


Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.

--- Content provided by FirstRanker.com ---

5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:

--- Content provided by FirstRanker.com ---

Login page
User Name:
GEETHA

password:

--- Content provided by FirstRanker.com ---

*****

Login


--- Content provided by FirstRanker.com ---

New User?Register

Hello World! from main page


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the spring application was executed successfully.

42

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

Applications:
1. Data access in Spring Framework.

--- Content provided by FirstRanker.com ---

2. ERP
3. Spring Boot



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





43

--- Content provided by FirstRanker.com ---


Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.
5. Display the contents of requested file.

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




44

--- Content provided by FirstRanker.com ---

Result:
Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



45

Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

--- Content provided by FirstRanker.com ---


Aim:
To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is
searching for an airline using Web Services and Data base
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:
1. Define the service's interface. This is done with WSDL

--- Content provided by FirstRanker.com ---

2. Implement the service. This is done with Java
3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done with Ant
5. Deploy service. This is also done with a GT4 tool

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

FirstRanker.com - FirstRanker's Choice

1


--- Content provided by FirstRanker.com ---

?




--- Content provided by FirstRanker.com ---

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---




LABORATORY MANUAL

--- Content provided by FirstRanker.com ---

2




--- Content provided by FirstRanker.com ---

College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry

--- Content provided by FirstRanker.com ---

? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


--- Content provided by FirstRanker.com ---

? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and

--- Content provided by FirstRanker.com ---

ethical practices




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering

--- Content provided by FirstRanker.com ---

that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth

--- Content provided by FirstRanker.com ---

To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their

--- Content provided by FirstRanker.com ---

communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



3

PROGRAMME OUTCOMES (POs)

--- Content provided by FirstRanker.com ---

a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions

--- Content provided by FirstRanker.com ---

e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal

--- Content provided by FirstRanker.com ---

and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---




? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets

--- Content provided by FirstRanker.com ---

? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.

--- Content provided by FirstRanker.com ---

5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form

--- Content provided by FirstRanker.com ---

4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---


5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user

--- Content provided by FirstRanker.com ---

information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is

--- Content provided by FirstRanker.com ---

typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,

--- Content provided by FirstRanker.com ---

opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and

--- Content provided by FirstRanker.com ---

sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---


1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---


6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---


d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.

--- Content provided by FirstRanker.com ---

2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It

--- Content provided by FirstRanker.com ---

requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.

--- Content provided by FirstRanker.com ---

2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,

--- Content provided by FirstRanker.com ---

Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---


d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.

--- Content provided by FirstRanker.com ---

3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information

--- Content provided by FirstRanker.com ---

from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP

--- Content provided by FirstRanker.com ---

iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server

--- Content provided by FirstRanker.com ---

i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---



? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet

--- Content provided by FirstRanker.com ---

? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7

--- Content provided by FirstRanker.com ---

2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18

--- Content provided by FirstRanker.com ---

c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets

--- Content provided by FirstRanker.com ---

a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36

--- Content provided by FirstRanker.com ---

10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45

--- Content provided by FirstRanker.com ---

14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---


16.
Design Online Quiz like Moodle Web Site

17.

--- Content provided by FirstRanker.com ---

Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---

19.
Design and Implement a Library Management System



--- Content provided by FirstRanker.com ---

10

Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

11




--- Content provided by FirstRanker.com ---




Result:
Thus the program of creating webpage with image mapping is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


--- Content provided by FirstRanker.com ---

12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.

--- Content provided by FirstRanker.com ---

3. Designing of Personal Web site like GoDaddy, Wedding Site




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




13

--- Content provided by FirstRanker.com ---

Expt.No.: 2 STYLE SHEETS

Aim:

To create a web page with the following

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---


1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.

--- Content provided by FirstRanker.com ---

5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

14

Embedded style sheet:


--- Content provided by FirstRanker.com ---




Cap.html:

--- Content provided by FirstRanker.com ---




External.html:

--- Content provided by FirstRanker.com ---

15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---


16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.

--- Content provided by FirstRanker.com ---

2. Designing web site validation of Registration and Feedback Queries of Web Sites.



18

--- Content provided by FirstRanker.com ---



Expt.No. 4.(a) : HTTP REQUEST

Aim:

--- Content provided by FirstRanker.com ---

To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request

--- Content provided by FirstRanker.com ---

5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request

--- Content provided by FirstRanker.com ---

Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---


Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets

--- Content provided by FirstRanker.com ---

3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:

--- Content provided by FirstRanker.com ---

F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---



20

[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---



Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server

--- Content provided by FirstRanker.com ---

6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server

--- Content provided by FirstRanker.com ---

11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection


--- Content provided by FirstRanker.com ---



Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---


22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:

--- Content provided by FirstRanker.com ---

Java
Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans

--- Content provided by FirstRanker.com ---

2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL

--- Content provided by FirstRanker.com ---

www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:
messages.length---298

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10

--- Content provided by FirstRanker.com ---

---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---

23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files

--- Content provided by FirstRanker.com ---

like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





24

--- Content provided by FirstRanker.com ---


Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---


To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:

Server Side
1. Import net and io packages and class

--- Content provided by FirstRanker.com ---

2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server

--- Content provided by FirstRanker.com ---

Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client

--- Content provided by FirstRanker.com ---

Hai
Hello how are you



--- Content provided by FirstRanker.com ---



25

Result:

--- Content provided by FirstRanker.com ---

Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





26

--- Content provided by FirstRanker.com ---


Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the

--- Content provided by FirstRanker.com ---

parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).

--- Content provided by FirstRanker.com ---

5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears

--- Content provided by FirstRanker.com ---

4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?

--- Content provided by FirstRanker.com ---

checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

--- Content provided by FirstRanker.com ---

27

Sample output:


--- Content provided by FirstRanker.com ---




.Result: Thus the program for invokes the servlet from html is written and executed successfully.

--- Content provided by FirstRanker.com ---

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:

--- Content provided by FirstRanker.com ---

To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.

--- Content provided by FirstRanker.com ---

iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet

--- Content provided by FirstRanker.com ---

3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




Sample output:

--- Content provided by FirstRanker.com ---


29



--- Content provided by FirstRanker.com ---

Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke

--- Content provided by FirstRanker.com ---

servlets from HTML forms and applets (CO5) has been attained.

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.

--- Content provided by FirstRanker.com ---

2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





30

--- Content provided by FirstRanker.com ---


Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database

--- Content provided by FirstRanker.com ---

2. Open the database connection
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:

--- Content provided by FirstRanker.com ---



31


--- Content provided by FirstRanker.com ---



Result:
Thus the online application of servlet using database was executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:
1. Design and Implement a Library Management System.

--- Content provided by FirstRanker.com ---


32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




33

--- Content provided by FirstRanker.com ---

Expt.No.8: LOCKING SERVER ITSELF

Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.

--- Content provided by FirstRanker.com ---

2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.

--- Content provided by FirstRanker.com ---

5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

34

Sample output:


--- Content provided by FirstRanker.com ---



Result:
Thus the servlet program of lock server itself was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




35

--- Content provided by FirstRanker.com ---

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

--- Content provided by FirstRanker.com ---

36

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:

--- Content provided by FirstRanker.com ---




38

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.

--- Content provided by FirstRanker.com ---

3. Track the Bus or Cab through Sessions.




--- Content provided by FirstRanker.com ---





39

--- Content provided by FirstRanker.com ---


Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page
ii. Creating a Success Page
3. Creating an Action Form Bean

--- Content provided by FirstRanker.com ---

4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml

--- Content provided by FirstRanker.com ---

7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

--- Content provided by FirstRanker.com ---


Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.

--- Content provided by FirstRanker.com ---


40


Result:

--- Content provided by FirstRanker.com ---

Thus the development of struts application is validated and implemented successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



41

Expt.No.12 SPRING FRAMEWORK

--- Content provided by FirstRanker.com ---


Aim:
To develop the spring application

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Create web project and spring frame work.

--- Content provided by FirstRanker.com ---

2. Configure dispatcher servlet.
3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.
6. Create view ,set command object.

--- Content provided by FirstRanker.com ---

7. Test your app.

Sample output:
Login page
User Name:

--- Content provided by FirstRanker.com ---

GEETHA

password:
*****

--- Content provided by FirstRanker.com ---

Login


New User?Register

--- Content provided by FirstRanker.com ---

Hello World! from main page




--- Content provided by FirstRanker.com ---



Result:
Thus the spring application was executed successfully.

--- Content provided by FirstRanker.com ---

42

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Data access in Spring Framework.
2. ERP
3. Spring Boot

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



43

Expt.No. 13: PROGRAM USING AJAX

--- Content provided by FirstRanker.com ---


Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.

--- Content provided by FirstRanker.com ---

3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.
5. Display the contents of requested file.

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


44

Result:
Thus the program for demonstrating Ajax is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Provide a Web service through JSON web pages.

--- Content provided by FirstRanker.com ---

2. Provide a Web service like Online Shopping




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

45

Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

Aim:

--- Content provided by FirstRanker.com ---

To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is
searching for an airline using Web Services and Data base
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Define the service's interface. This is done with WSDL
2. Implement the service. This is done with Java
3. Define the deployment parameters. This is done with WSDD and JNDI

--- Content provided by FirstRanker.com ---

4. Compile everything and generate a GAR file. This is done with Ant
5. Deploy service. This is also done with a GT4 tool


Sample output:

--- Content provided by FirstRanker.com ---





46

--- Content provided by FirstRanker.com ---




Result:
Thus the program to develop the scenario of two web Services- an airline service and travel agent is

--- Content provided by FirstRanker.com ---

searching for an airline using Web Services and Data base is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---


handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)

--- Content provided by FirstRanker.com ---

would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer

--- Content provided by FirstRanker.com ---

h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets

--- Content provided by FirstRanker.com ---

? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student

--- Content provided by FirstRanker.com ---

? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS

--- Content provided by FirstRanker.com ---

1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17

--- Content provided by FirstRanker.com ---

b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23

--- Content provided by FirstRanker.com ---

6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33

--- Content provided by FirstRanker.com ---

9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43

--- Content provided by FirstRanker.com ---

13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering

--- Content provided by FirstRanker.com ---

Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---

17.
Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---


19.
Design and Implement a Library Management System


--- Content provided by FirstRanker.com ---


10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots

--- Content provided by FirstRanker.com ---

(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.

--- Content provided by FirstRanker.com ---

5. Load the india.html page using internet explorer.

Sample output:


--- Content provided by FirstRanker.com ---


11



--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---


12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter

--- Content provided by FirstRanker.com ---

2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





13

--- Content provided by FirstRanker.com ---


Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages

--- Content provided by FirstRanker.com ---

4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:

--- Content provided by FirstRanker.com ---

Inline style sheet:




--- Content provided by FirstRanker.com ---


14

Embedded style sheet:

--- Content provided by FirstRanker.com ---





Cap.html:

--- Content provided by FirstRanker.com ---





External.html:

--- Content provided by FirstRanker.com ---


15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.

--- Content provided by FirstRanker.com ---

Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute

--- Content provided by FirstRanker.com ---

3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




17

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of

--- Content provided by FirstRanker.com ---

TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.



--- Content provided by FirstRanker.com ---

18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post

--- Content provided by FirstRanker.com ---

4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"

--- Content provided by FirstRanker.com ---

itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



19


--- Content provided by FirstRanker.com ---

Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP

--- Content provided by FirstRanker.com ---

2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---

Sample output:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---




20

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




21

--- Content provided by FirstRanker.com ---

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server

--- Content provided by FirstRanker.com ---

5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps

--- Content provided by FirstRanker.com ---

10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---




Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---


Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---

Software requirements:
Java
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message

--- Content provided by FirstRanker.com ---

5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:

--- Content provided by FirstRanker.com ---

messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---


23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


--- Content provided by FirstRanker.com ---

Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:

Server Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string

--- Content provided by FirstRanker.com ---

Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client

--- Content provided by FirstRanker.com ---

Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server

--- Content provided by FirstRanker.com ---

Server is waiting for data received from client
Hai
Hello how are you


--- Content provided by FirstRanker.com ---




25

--- Content provided by FirstRanker.com ---

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been

--- Content provided by FirstRanker.com ---

attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:

--- Content provided by FirstRanker.com ---

To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet

--- Content provided by FirstRanker.com ---

iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).

--- Content provided by FirstRanker.com ---

4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).

--- Content provided by FirstRanker.com ---

3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?

--- Content provided by FirstRanker.com ---

, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

--- Content provided by FirstRanker.com ---


27

Sample output:

--- Content provided by FirstRanker.com ---





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

--- Content provided by FirstRanker.com ---


28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.

--- Content provided by FirstRanker.com ---

ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().

--- Content provided by FirstRanker.com ---

2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---



29


--- Content provided by FirstRanker.com ---


Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC

--- Content provided by FirstRanker.com ---

1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.

--- Content provided by FirstRanker.com ---

Sample output:


31

--- Content provided by FirstRanker.com ---




Result:
Thus the online application of servlet using database was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.

--- Content provided by FirstRanker.com ---

3. Design and Implement an Online Quiz




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





33

--- Content provided by FirstRanker.com ---


Expt.No.8: LOCKING SERVER ITSELF

Aim:
To create a servlet program locks itself to a particular server IP address and port number

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.

--- Content provided by FirstRanker.com ---

4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


34

Sample output:

--- Content provided by FirstRanker.com ---




Result:
Thus the servlet program of lock server itself was executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





35

--- Content provided by FirstRanker.com ---


Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

--- Content provided by FirstRanker.com ---


36

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP

--- Content provided by FirstRanker.com ---

and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.

--- Content provided by FirstRanker.com ---

3. Designing a web page to display number of times visited the same web page.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Sample output:



38

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and

--- Content provided by FirstRanker.com ---

Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.

--- Content provided by FirstRanker.com ---

2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:

--- Content provided by FirstRanker.com ---

To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page
ii. Creating a Success Page

--- Content provided by FirstRanker.com ---

3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message

--- Content provided by FirstRanker.com ---

6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application

--- Content provided by FirstRanker.com ---

Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.

--- Content provided by FirstRanker.com ---



40


--- Content provided by FirstRanker.com ---

Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




41

--- Content provided by FirstRanker.com ---

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.

--- Content provided by FirstRanker.com ---

6. Create view ,set command object.
7. Test your app.

Sample output:
Login page

--- Content provided by FirstRanker.com ---

User Name:
GEETHA

password:
*****

--- Content provided by FirstRanker.com ---


Login


New User?Register

--- Content provided by FirstRanker.com ---


Hello World! from main page



--- Content provided by FirstRanker.com ---




Result:
Thus the spring application was executed successfully.

--- Content provided by FirstRanker.com ---


42

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.

Applications:
1. Data access in Spring Framework.
2. ERP

--- Content provided by FirstRanker.com ---

3. Spring Boot




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




43

--- Content provided by FirstRanker.com ---

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Use JavaScript to initialize the XML HTML request object.

--- Content provided by FirstRanker.com ---

2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.
5. Display the contents of requested file.

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



44

Result:

--- Content provided by FirstRanker.com ---

Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


45

Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

--- Content provided by FirstRanker.com ---

Aim:
To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is
searching for an airline using Web Services and Data base
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Define the service's interface. This is done with WSDL
2. Implement the service. This is done with Java

--- Content provided by FirstRanker.com ---

3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done with Ant
5. Deploy service. This is also done with a GT4 tool


--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---

46



Result:

--- Content provided by FirstRanker.com ---

Thus the program to develop the scenario of two web Services- an airline service and travel agent is
searching for an airline using Web Services and Data base is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




47

--- Content provided by FirstRanker.com ---





Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


1. Write the syntax and tags about tables.

2. What are the various types of lists?

--- Content provided by FirstRanker.com ---

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

--- Content provided by FirstRanker.com ---

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

--- Content provided by FirstRanker.com ---


9. Compare HTML and XHTML.

10. What is URL?

--- Content provided by FirstRanker.com ---



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

--- Content provided by FirstRanker.com ---


2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

--- Content provided by FirstRanker.com ---

4. Define- Style sheet.

5. Discuss about embedded style sheets?

6. What are the style precedence rules when using multiple approaches?

--- Content provided by FirstRanker.com ---


7. List down the ways of including style information in a document.

8. Define cascading.

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

--- Content provided by FirstRanker.com ---

2. Write about XML Elements.
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---


?



--- Content provided by FirstRanker.com ---


DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

V SEMESTER - R 2013




--- Content provided by FirstRanker.com ---




Name : ______________________________________
Register No. : ______________________________________

--- Content provided by FirstRanker.com ---

Section : ______________________________________



LABORATORY MANUAL

--- Content provided by FirstRanker.com ---


2



--- Content provided by FirstRanker.com ---


College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.


--- Content provided by FirstRanker.com ---

? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems

--- Content provided by FirstRanker.com ---

? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


VISION
VISION
MISSION
MISSION

--- Content provided by FirstRanker.com ---


2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals

--- Content provided by FirstRanker.com ---

To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them

--- Content provided by FirstRanker.com ---

3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills

--- Content provided by FirstRanker.com ---

To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




3

--- Content provided by FirstRanker.com ---

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications

--- Content provided by FirstRanker.com ---

d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable

--- Content provided by FirstRanker.com ---

h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



4

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

SYLLABUS



? Be familiar with Web page design using HTML/XML and style sheets

--- Content provided by FirstRanker.com ---

? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX

--- Content provided by FirstRanker.com ---

LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.

--- Content provided by FirstRanker.com ---

4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:

--- Content provided by FirstRanker.com ---

a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table

--- Content provided by FirstRanker.com ---

3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---

COURSE OBJECTIVES

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address

--- Content provided by FirstRanker.com ---

of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,

--- Content provided by FirstRanker.com ---

and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.

--- Content provided by FirstRanker.com ---

2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for

--- Content provided by FirstRanker.com ---

communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.

--- Content provided by FirstRanker.com ---

4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also

--- Content provided by FirstRanker.com ---

displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.

--- Content provided by FirstRanker.com ---

1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

--- Content provided by FirstRanker.com ---


g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting

--- Content provided by FirstRanker.com ---

the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---

7

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.

--- Content provided by FirstRanker.com ---

2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked

--- Content provided by FirstRanker.com ---

e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a

--- Content provided by FirstRanker.com ---

Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request

--- Content provided by FirstRanker.com ---

ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a

--- Content provided by FirstRanker.com ---

database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

--- Content provided by FirstRanker.com ---


handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)

--- Content provided by FirstRanker.com ---

would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer

--- Content provided by FirstRanker.com ---

h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets

--- Content provided by FirstRanker.com ---

? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student

--- Content provided by FirstRanker.com ---

? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



COURSE OUTCOMES

9

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS

--- Content provided by FirstRanker.com ---

1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17

--- Content provided by FirstRanker.com ---

b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23

--- Content provided by FirstRanker.com ---

6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33

--- Content provided by FirstRanker.com ---

9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43

--- Content provided by FirstRanker.com ---

13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.
Design the fields to map the location of College of Engineering

--- Content provided by FirstRanker.com ---

Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---

17.
Inventory Management System using JSP with XAMPP

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

--- Content provided by FirstRanker.com ---


19.
Design and Implement a Library Management System


--- Content provided by FirstRanker.com ---


10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots

--- Content provided by FirstRanker.com ---

(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.

--- Content provided by FirstRanker.com ---

5. Load the india.html page using internet explorer.

Sample output:


--- Content provided by FirstRanker.com ---


11



--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---


12

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter

--- Content provided by FirstRanker.com ---

2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





13

--- Content provided by FirstRanker.com ---


Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages

--- Content provided by FirstRanker.com ---

4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:

--- Content provided by FirstRanker.com ---

Inline style sheet:




--- Content provided by FirstRanker.com ---


14

Embedded style sheet:

--- Content provided by FirstRanker.com ---





Cap.html:

--- Content provided by FirstRanker.com ---





External.html:

--- Content provided by FirstRanker.com ---


15


Caps.html:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.

--- Content provided by FirstRanker.com ---

Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute

--- Content provided by FirstRanker.com ---

3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




17

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of

--- Content provided by FirstRanker.com ---

TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.



--- Content provided by FirstRanker.com ---

18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post

--- Content provided by FirstRanker.com ---

4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"

--- Content provided by FirstRanker.com ---

itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



19


--- Content provided by FirstRanker.com ---

Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP

--- Content provided by FirstRanker.com ---

2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---

Sample output:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main

--- Content provided by FirstRanker.com ---




20

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




21

--- Content provided by FirstRanker.com ---

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server

--- Content provided by FirstRanker.com ---

5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps

--- Content provided by FirstRanker.com ---

10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---




Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

--- Content provided by FirstRanker.com ---


Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---

Software requirements:
Java
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message

--- Content provided by FirstRanker.com ---

5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

Sample output:

--- Content provided by FirstRanker.com ---

messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P

--- Content provided by FirstRanker.com ---

Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

--- Content provided by FirstRanker.com ---


23

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


--- Content provided by FirstRanker.com ---

Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:

Server Side

--- Content provided by FirstRanker.com ---

1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string

--- Content provided by FirstRanker.com ---

Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client

--- Content provided by FirstRanker.com ---

Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server

--- Content provided by FirstRanker.com ---

Server is waiting for data received from client
Hai
Hello how are you


--- Content provided by FirstRanker.com ---




25

--- Content provided by FirstRanker.com ---

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been

--- Content provided by FirstRanker.com ---

attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:

--- Content provided by FirstRanker.com ---

To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet

--- Content provided by FirstRanker.com ---

iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).

--- Content provided by FirstRanker.com ---

4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).

--- Content provided by FirstRanker.com ---

3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?

--- Content provided by FirstRanker.com ---

, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

--- Content provided by FirstRanker.com ---


27

Sample output:

--- Content provided by FirstRanker.com ---





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

--- Content provided by FirstRanker.com ---


28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.

--- Content provided by FirstRanker.com ---

ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().

--- Content provided by FirstRanker.com ---

2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---



29


--- Content provided by FirstRanker.com ---


Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC

--- Content provided by FirstRanker.com ---

1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.

--- Content provided by FirstRanker.com ---

Sample output:


31

--- Content provided by FirstRanker.com ---




Result:
Thus the online application of servlet using database was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.

--- Content provided by FirstRanker.com ---

3. Design and Implement an Online Quiz




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





33

--- Content provided by FirstRanker.com ---


Expt.No.8: LOCKING SERVER ITSELF

Aim:
To create a servlet program locks itself to a particular server IP address and port number

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.

--- Content provided by FirstRanker.com ---

4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


34

Sample output:

--- Content provided by FirstRanker.com ---




Result:
Thus the servlet program of lock server itself was executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





35

--- Content provided by FirstRanker.com ---


Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

--- Content provided by FirstRanker.com ---


36

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP

--- Content provided by FirstRanker.com ---

and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.

--- Content provided by FirstRanker.com ---

3. Designing a web page to display number of times visited the same web page.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Sample output:



38

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and

--- Content provided by FirstRanker.com ---

Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.

--- Content provided by FirstRanker.com ---

2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:

--- Content provided by FirstRanker.com ---

To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page
ii. Creating a Success Page

--- Content provided by FirstRanker.com ---

3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message

--- Content provided by FirstRanker.com ---

6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application

--- Content provided by FirstRanker.com ---

Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.

--- Content provided by FirstRanker.com ---



40


--- Content provided by FirstRanker.com ---

Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




41

--- Content provided by FirstRanker.com ---

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.

--- Content provided by FirstRanker.com ---

6. Create view ,set command object.
7. Test your app.

Sample output:
Login page

--- Content provided by FirstRanker.com ---

User Name:
GEETHA

password:
*****

--- Content provided by FirstRanker.com ---


Login


New User?Register

--- Content provided by FirstRanker.com ---


Hello World! from main page



--- Content provided by FirstRanker.com ---




Result:
Thus the spring application was executed successfully.

--- Content provided by FirstRanker.com ---


42

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.

Applications:
1. Data access in Spring Framework.
2. ERP

--- Content provided by FirstRanker.com ---

3. Spring Boot




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




43

--- Content provided by FirstRanker.com ---

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Use JavaScript to initialize the XML HTML request object.

--- Content provided by FirstRanker.com ---

2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.
5. Display the contents of requested file.

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---



44

Result:

--- Content provided by FirstRanker.com ---

Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


45

Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

--- Content provided by FirstRanker.com ---

Aim:
To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is
searching for an airline using Web Services and Data base
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Define the service's interface. This is done with WSDL
2. Implement the service. This is done with Java

--- Content provided by FirstRanker.com ---

3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done with Ant
5. Deploy service. This is also done with a GT4 tool


--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---

46



Result:

--- Content provided by FirstRanker.com ---

Thus the program to develop the scenario of two web Services- an airline service and travel agent is
searching for an airline using Web Services and Data base is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




47

--- Content provided by FirstRanker.com ---





Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


1. Write the syntax and tags about tables.

2. What are the various types of lists?

--- Content provided by FirstRanker.com ---

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

--- Content provided by FirstRanker.com ---

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

--- Content provided by FirstRanker.com ---


9. Compare HTML and XHTML.

10. What is URL?

--- Content provided by FirstRanker.com ---



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

--- Content provided by FirstRanker.com ---


2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

--- Content provided by FirstRanker.com ---

4. Define- Style sheet.

5. Discuss about embedded style sheets?

6. What are the style precedence rules when using multiple approaches?

--- Content provided by FirstRanker.com ---


7. List down the ways of including style information in a document.

8. Define cascading.

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

--- Content provided by FirstRanker.com ---

2. Write about XML Elements.

48

3. What is XML?

--- Content provided by FirstRanker.com ---


4. Differentiate XML From HTML.

5. What is DHTML?

--- Content provided by FirstRanker.com ---

6. What are the form tags available in html?

7. What is the use of submit button?

8. What is URN?

--- Content provided by FirstRanker.com ---


9. What is URI?

10. Differentiate client side scripting from server side scripting.

--- Content provided by FirstRanker.com ---


Expt.No. 4: PROTOCOLS


1. What is POP3?

--- Content provided by FirstRanker.com ---


2. What are the steps to execute POP3?

3. What is FTP?

--- Content provided by FirstRanker.com ---

4. What is the difference between GET and POST method?

5. What is meant by http protocol?

6. How to make the connection with TCP?

--- Content provided by FirstRanker.com ---


7. Limitations of HTTP.

8. What is HTTP Session?

--- Content provided by FirstRanker.com ---

9.What is meant by loop back address?

10.What are the issues of next generation IP?


--- Content provided by FirstRanker.com ---



Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

1. What is meant by Socket :

--- Content provided by FirstRanker.com ---

2. What are the two basic protocols used for transmitting the message?

3. What is meant by UDP?

FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---





College of Engineering is committed to provide highly disciplined, conscientious and

--- Content provided by FirstRanker.com ---

enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels

--- Content provided by FirstRanker.com ---

? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics

--- Content provided by FirstRanker.com ---

industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





VISION

--- Content provided by FirstRanker.com ---

VISION
MISSION
MISSION

2

--- Content provided by FirstRanker.com ---


ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals

--- Content provided by FirstRanker.com ---

2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to

--- Content provided by FirstRanker.com ---

find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in

--- Content provided by FirstRanker.com ---

ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools

--- Content provided by FirstRanker.com ---

f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms

--- Content provided by FirstRanker.com ---

i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---



? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.

--- Content provided by FirstRanker.com ---

? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom

--- Content provided by FirstRanker.com ---

of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles

--- Content provided by FirstRanker.com ---

should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types

--- Content provided by FirstRanker.com ---

5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.

--- Content provided by FirstRanker.com ---

1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and

--- Content provided by FirstRanker.com ---

email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.

--- Content provided by FirstRanker.com ---

3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.

--- Content provided by FirstRanker.com ---

3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it

--- Content provided by FirstRanker.com ---

unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.

--- Content provided by FirstRanker.com ---

3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web

--- Content provided by FirstRanker.com ---

pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.

--- Content provided by FirstRanker.com ---

4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an

--- Content provided by FirstRanker.com ---

init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

handles a request

--- Content provided by FirstRanker.com ---

j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the

--- Content provided by FirstRanker.com ---

answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)

--- Content provided by FirstRanker.com ---

? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL

--- Content provided by FirstRanker.com ---

? Implement a program using AJAX, Spring, Struts and Web services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10

--- Content provided by FirstRanker.com ---

3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20

--- Content provided by FirstRanker.com ---

d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25

--- Content provided by FirstRanker.com ---

b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38

--- Content provided by FirstRanker.com ---

CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47

--- Content provided by FirstRanker.com ---

MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---


18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.

--- Content provided by FirstRanker.com ---

Design and Implement a Library Management System



10

--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.

--- Content provided by FirstRanker.com ---

2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:



11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---


Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.

--- Content provided by FirstRanker.com ---

6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---





14

--- Content provided by FirstRanker.com ---


Embedded style sheet:



--- Content provided by FirstRanker.com ---



Cap.html:


--- Content provided by FirstRanker.com ---



External.html:

15

--- Content provided by FirstRanker.com ---



Caps.html:


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the website with college information using internal and external cascading style

--- Content provided by FirstRanker.com ---

sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :

--- Content provided by FirstRanker.com ---

To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.

--- Content provided by FirstRanker.com ---

2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get

--- Content provided by FirstRanker.com ---

Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---




18

--- Content provided by FirstRanker.com ---


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language

--- Content provided by FirstRanker.com ---

6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/

--- Content provided by FirstRanker.com ---

Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the http request messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method

--- Content provided by FirstRanker.com ---

4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :3
F:\IP\client>java Main


--- Content provided by FirstRanker.com ---


20

[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...

--- Content provided by FirstRanker.com ---

File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...
GET Command Received ...
Waiting for Command ...


--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server

--- Content provided by FirstRanker.com ---

2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server

--- Content provided by FirstRanker.com ---

7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server

--- Content provided by FirstRanker.com ---

12. Read the acceptance of message from server
13. Close the connection



--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---

22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---


To write a program in Java using sockets to implement the pop3

Software requirements:
Java

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax

--- Content provided by FirstRanker.com ---

mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps

--- Content provided by FirstRanker.com ---

6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.

--- Content provided by FirstRanker.com ---

2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




24

--- Content provided by FirstRanker.com ---

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet

--- Content provided by FirstRanker.com ---

3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages

--- Content provided by FirstRanker.com ---

2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai

--- Content provided by FirstRanker.com ---

Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai

--- Content provided by FirstRanker.com ---

Hello how are you




--- Content provided by FirstRanker.com ---


25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




26

--- Content provided by FirstRanker.com ---

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:

--- Content provided by FirstRanker.com ---

i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter

--- Content provided by FirstRanker.com ---

values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.

--- Content provided by FirstRanker.com ---

5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish

--- Content provided by FirstRanker.com ---

7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---



.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---


Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().

--- Content provided by FirstRanker.com ---

iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.

--- Content provided by FirstRanker.com ---

4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Sample output:


--- Content provided by FirstRanker.com ---

29



Result:

--- Content provided by FirstRanker.com ---

Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---


Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




30

--- Content provided by FirstRanker.com ---

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.

--- Content provided by FirstRanker.com ---

6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection

--- Content provided by FirstRanker.com ---

3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:

--- Content provided by FirstRanker.com ---


31



--- Content provided by FirstRanker.com ---


Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database

--- Content provided by FirstRanker.com ---

for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:
1. Design and Implement a Library Management System.

--- Content provided by FirstRanker.com ---

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---


Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself

--- Content provided by FirstRanker.com ---

and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address

--- Content provided by FirstRanker.com ---

Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





34

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---


Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



35

Expt.No.: 9 SESSION TRACKING IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---


Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





37

--- Content provided by FirstRanker.com ---


Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:

--- Content provided by FirstRanker.com ---



38


--- Content provided by FirstRanker.com ---




Result:
Thus the sessions servlet and cookie servlet was executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




39

--- Content provided by FirstRanker.com ---

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Setting Up a Struts Application

--- Content provided by FirstRanker.com ---

2. Creating JSP Pages
i. Creating a Login Page
ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class

--- Content provided by FirstRanker.com ---

5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application

--- Content provided by FirstRanker.com ---

i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

--- Content provided by FirstRanker.com ---

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


--- Content provided by FirstRanker.com ---

40


Result:
Thus the development of struts application is validated and implemented successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Designing a web page like Java Web Tutor.

--- Content provided by FirstRanker.com ---

2. Online Accounting
3. Displaying of E-Books



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


41

Expt.No.12 SPRING FRAMEWORK

--- Content provided by FirstRanker.com ---

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.

--- Content provided by FirstRanker.com ---

3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

--- Content provided by FirstRanker.com ---


Sample output:
Login page
User Name:
GEETHA

--- Content provided by FirstRanker.com ---


password:
*****

Login

--- Content provided by FirstRanker.com ---



New User?Register

Hello World! from main page

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the spring application was executed successfully.

42

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Data access in Spring Framework.
2. ERP
3. Spring Boot

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


43

Expt.No. 13: PROGRAM USING AJAX

--- Content provided by FirstRanker.com ---

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.

--- Content provided by FirstRanker.com ---

4. Process the data on a server use JavaScript to process any response from the server.
5. Display the contents of requested file.

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

44

Result:
Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





45

--- Content provided by FirstRanker.com ---


Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

Aim:
To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is

--- Content provided by FirstRanker.com ---

searching for an airline using Web Services and Data base
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Define the service's interface. This is done with WSDL
2. Implement the service. This is done with Java
3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done with Ant

--- Content provided by FirstRanker.com ---

5. Deploy service. This is also done with a GT4 tool


Sample output:

--- Content provided by FirstRanker.com ---




46

--- Content provided by FirstRanker.com ---



Result:
Thus the program to develop the scenario of two web Services- an airline service and travel agent is
searching for an airline using Web Services and Data base is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Airline Reservation System

--- Content provided by FirstRanker.com ---

2. Online Ticket Reservation System
3. Amazon Web Services



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


47



--- Content provided by FirstRanker.com ---



Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

--- Content provided by FirstRanker.com ---


2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

--- Content provided by FirstRanker.com ---


5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

--- Content provided by FirstRanker.com ---

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

--- Content provided by FirstRanker.com ---


10. What is URL?



--- Content provided by FirstRanker.com ---

Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

--- Content provided by FirstRanker.com ---


3. What is CSS?

4. Define- Style sheet.

--- Content provided by FirstRanker.com ---

5. Discuss about embedded style sheets?

6. What are the style precedence rules when using multiple approaches?

7. List down the ways of including style information in a document.

--- Content provided by FirstRanker.com ---


8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


1. Describe about Java Scripts

2. Write about XML Elements.

--- Content provided by FirstRanker.com ---

48

3. What is XML?

4. Differentiate XML From HTML.

--- Content provided by FirstRanker.com ---


5. What is DHTML?

6. What are the form tags available in html?

--- Content provided by FirstRanker.com ---

7. What is the use of submit button?

8. What is URN?

9. What is URI?

--- Content provided by FirstRanker.com ---


10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS

--- Content provided by FirstRanker.com ---



1. What is POP3?

2. What are the steps to execute POP3?

--- Content provided by FirstRanker.com ---


3. What is FTP?

4. What is the difference between GET and POST method?

--- Content provided by FirstRanker.com ---

5. What is meant by http protocol?

6. How to make the connection with TCP?

7. Limitations of HTTP.

--- Content provided by FirstRanker.com ---


8. What is HTTP Session?

9.What is meant by loop back address?

--- Content provided by FirstRanker.com ---

10.What are the issues of next generation IP?




--- Content provided by FirstRanker.com ---

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

1. What is meant by Socket :
2. What are the two basic protocols used for transmitting the message?

--- Content provided by FirstRanker.com ---

3. What is meant by UDP?


49

--- Content provided by FirstRanker.com ---

4. What is the major difference between UDP and TCP/IP Protocol?

5. What is IP address?

6. What is OSI?

--- Content provided by FirstRanker.com ---

7. What is router?

8. What do you mean by hub?

9. What is URL?

--- Content provided by FirstRanker.com ---


10. Define packet switched networks.



--- Content provided by FirstRanker.com ---

Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

1. What is applet?

2. Explain applet life cycle?

--- Content provided by FirstRanker.com ---


3. How will you establish the connection between the servlet and an applet?

4. Can we pass parameters to an applet using
5. Compare Client and Server.

--- Content provided by FirstRanker.com ---


6. Compare swing and applet?

7. Differentiate between Servlet andApplet.

--- Content provided by FirstRanker.com ---




Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

1. What are servlets?

2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

--- Content provided by FirstRanker.com ---


4. When doPost() method of servlet to be called?

5. How to make database connection with servlet?

--- Content provided by FirstRanker.com ---

6. What is HttpSession?
7. What is CGI?

8. What are the SQL commands used for database in servlet?
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---


1


?

--- Content provided by FirstRanker.com ---





DEPARTMENT OF

--- Content provided by FirstRanker.com ---

COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________

--- Content provided by FirstRanker.com ---



LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---





College of Engineering is committed to provide highly disciplined, conscientious and

--- Content provided by FirstRanker.com ---

enterprising professionals conforming to global standards through value based quality education and training.


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels

--- Content provided by FirstRanker.com ---

? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics

--- Content provided by FirstRanker.com ---

industry
? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





VISION

--- Content provided by FirstRanker.com ---

VISION
MISSION
MISSION

2

--- Content provided by FirstRanker.com ---


ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals

--- Content provided by FirstRanker.com ---

2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to

--- Content provided by FirstRanker.com ---

find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in

--- Content provided by FirstRanker.com ---

ever changing technologies
5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and

--- Content provided by FirstRanker.com ---

Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools

--- Content provided by FirstRanker.com ---

f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms

--- Content provided by FirstRanker.com ---

i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS

--- Content provided by FirstRanker.com ---



? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.

--- Content provided by FirstRanker.com ---

? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS

--- Content provided by FirstRanker.com ---

a) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom

--- Content provided by FirstRanker.com ---

of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles

--- Content provided by FirstRanker.com ---

should be underlined, adjectives should be italicized and bolded.

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types

--- Content provided by FirstRanker.com ---

5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

COURSE OBJECTIVES

--- Content provided by FirstRanker.com ---

5

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.

--- Content provided by FirstRanker.com ---

1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and

--- Content provided by FirstRanker.com ---

email address.
4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.

--- Content provided by FirstRanker.com ---

3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

--- Content provided by FirstRanker.com ---

6

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

--- Content provided by FirstRanker.com ---

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.

--- Content provided by FirstRanker.com ---

3. To create the Students database for their mark list.
4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it

--- Content provided by FirstRanker.com ---

unlocks itself and handles a request.

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.

--- Content provided by FirstRanker.com ---

3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web

--- Content provided by FirstRanker.com ---

pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

7

--- Content provided by FirstRanker.com ---

d) Write a web services for predicting for any product sales

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.

--- Content provided by FirstRanker.com ---

4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document

--- Content provided by FirstRanker.com ---

SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP

--- Content provided by FirstRanker.com ---

iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms

--- Content provided by FirstRanker.com ---

iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an

--- Content provided by FirstRanker.com ---

init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

8

handles a request

--- Content provided by FirstRanker.com ---

j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:

--- Content provided by FirstRanker.com ---

e) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the

--- Content provided by FirstRanker.com ---

answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)

--- Content provided by FirstRanker.com ---

? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL

--- Content provided by FirstRanker.com ---

? Implement a program using AJAX, Spring, Struts and Web services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY

--- Content provided by FirstRanker.com ---

CONTENTS
Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10

--- Content provided by FirstRanker.com ---

3. Web Form Validation of Xml Using Java Script 14
4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20

--- Content provided by FirstRanker.com ---

d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25

--- Content provided by FirstRanker.com ---

b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38

--- Content provided by FirstRanker.com ---

CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47

--- Content provided by FirstRanker.com ---

MINI PROJECTS
15.
Design the fields to map the location of College of Engineering
Website

--- Content provided by FirstRanker.com ---

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---


18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.

--- Content provided by FirstRanker.com ---

Design and Implement a Library Management System



10

--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

Aim:

--- Content provided by FirstRanker.com ---

To create a web page with the following using HTML
(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.

--- Content provided by FirstRanker.com ---

2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:



11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---


Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following
a. Cascading style sheets

--- Content provided by FirstRanker.com ---

b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS

Algorithm:

--- Content provided by FirstRanker.com ---

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.

--- Content provided by FirstRanker.com ---

6. Then link the html file and css file using tag
7. Load each files using internet explorer.
Sample output:
Inline style sheet:

--- Content provided by FirstRanker.com ---





14

--- Content provided by FirstRanker.com ---


Embedded style sheet:



--- Content provided by FirstRanker.com ---



Cap.html:


--- Content provided by FirstRanker.com ---



External.html:

15

--- Content provided by FirstRanker.com ---



Caps.html:


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the website with college information using internal and external cascading style

--- Content provided by FirstRanker.com ---

sheets is written and executed successfully.
Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

--- Content provided by FirstRanker.com ---

16

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :

--- Content provided by FirstRanker.com ---

To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer
Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.

--- Content provided by FirstRanker.com ---

2. Design the HTML page with the following :
a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get

--- Content provided by FirstRanker.com ---

Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


17

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML

--- Content provided by FirstRanker.com ---

(CO3) has been attained.
Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---




18

--- Content provided by FirstRanker.com ---


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language

--- Content provided by FirstRanker.com ---

6. Read the content of URL and print i
Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/

--- Content provided by FirstRanker.com ---

Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the http request messages has been executed
successfully.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

--- Content provided by FirstRanker.com ---

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method

--- Content provided by FirstRanker.com ---

4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1

--- Content provided by FirstRanker.com ---

Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :3
F:\IP\client>java Main


--- Content provided by FirstRanker.com ---


20

[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...

--- Content provided by FirstRanker.com ---

File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...
GET Command Received ...
Waiting for Command ...


--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server

--- Content provided by FirstRanker.com ---

2. Read the acceptance from the server
3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server

--- Content provided by FirstRanker.com ---

7. Send recipient address to server
8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server

--- Content provided by FirstRanker.com ---

12. Read the acceptance of message from server
13. Close the connection



--- Content provided by FirstRanker.com ---


Sample output:

F:\JAVA\BIN>javac smtp.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



--- Content provided by FirstRanker.com ---

22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---


To write a program in Java using sockets to implement the pop3

Software requirements:
Java

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax

--- Content provided by FirstRanker.com ---

mail
3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps

--- Content provided by FirstRanker.com ---

6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------

--- Content provided by FirstRanker.com ---

Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.

--- Content provided by FirstRanker.com ---

2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




24

--- Content provided by FirstRanker.com ---

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet

--- Content provided by FirstRanker.com ---

3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages

--- Content provided by FirstRanker.com ---

2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai

--- Content provided by FirstRanker.com ---

Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai

--- Content provided by FirstRanker.com ---

Hello how are you




--- Content provided by FirstRanker.com ---


25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




26

--- Content provided by FirstRanker.com ---

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:

--- Content provided by FirstRanker.com ---

i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter

--- Content provided by FirstRanker.com ---

values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.

--- Content provided by FirstRanker.com ---

Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.

--- Content provided by FirstRanker.com ---

5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish

--- Content provided by FirstRanker.com ---

7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---



.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---


Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().

--- Content provided by FirstRanker.com ---

iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.

--- Content provided by FirstRanker.com ---

4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Sample output:


--- Content provided by FirstRanker.com ---

29



Result:

--- Content provided by FirstRanker.com ---

Thus the program for invokes the servlet from applets is written and executed successfully.

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---


Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




30

--- Content provided by FirstRanker.com ---

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.

--- Content provided by FirstRanker.com ---

6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection

--- Content provided by FirstRanker.com ---

3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:

--- Content provided by FirstRanker.com ---


31



--- Content provided by FirstRanker.com ---


Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database

--- Content provided by FirstRanker.com ---

for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

Applications:
1. Design and Implement a Library Management System.

--- Content provided by FirstRanker.com ---

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---


Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself

--- Content provided by FirstRanker.com ---

and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address

--- Content provided by FirstRanker.com ---

Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





34

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---


Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



35

Expt.No.: 9 SESSION TRACKING IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---


Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





37

--- Content provided by FirstRanker.com ---


Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:

--- Content provided by FirstRanker.com ---



38


--- Content provided by FirstRanker.com ---




Result:
Thus the sessions servlet and cookie servlet was executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




39

--- Content provided by FirstRanker.com ---

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Setting Up a Struts Application

--- Content provided by FirstRanker.com ---

2. Creating JSP Pages
i. Creating a Login Page
ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class

--- Content provided by FirstRanker.com ---

5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application

--- Content provided by FirstRanker.com ---

i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

--- Content provided by FirstRanker.com ---

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


--- Content provided by FirstRanker.com ---

40


Result:
Thus the development of struts application is validated and implemented successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Designing a web page like Java Web Tutor.

--- Content provided by FirstRanker.com ---

2. Online Accounting
3. Displaying of E-Books



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


41

Expt.No.12 SPRING FRAMEWORK

--- Content provided by FirstRanker.com ---

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.

--- Content provided by FirstRanker.com ---

3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

--- Content provided by FirstRanker.com ---


Sample output:
Login page
User Name:
GEETHA

--- Content provided by FirstRanker.com ---


password:
*****

Login

--- Content provided by FirstRanker.com ---



New User?Register

Hello World! from main page

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the spring application was executed successfully.

42

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Data access in Spring Framework.
2. ERP
3. Spring Boot

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


43

Expt.No. 13: PROGRAM USING AJAX

--- Content provided by FirstRanker.com ---

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.

--- Content provided by FirstRanker.com ---

4. Process the data on a server use JavaScript to process any response from the server.
5. Display the contents of requested file.

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

44

Result:
Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





45

--- Content provided by FirstRanker.com ---


Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

Aim:
To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is

--- Content provided by FirstRanker.com ---

searching for an airline using Web Services and Data base
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Define the service's interface. This is done with WSDL
2. Implement the service. This is done with Java
3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done with Ant

--- Content provided by FirstRanker.com ---

5. Deploy service. This is also done with a GT4 tool


Sample output:

--- Content provided by FirstRanker.com ---




46

--- Content provided by FirstRanker.com ---



Result:
Thus the program to develop the scenario of two web Services- an airline service and travel agent is
searching for an airline using Web Services and Data base is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Airline Reservation System

--- Content provided by FirstRanker.com ---

2. Online Ticket Reservation System
3. Amazon Web Services



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


47



--- Content provided by FirstRanker.com ---



Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

--- Content provided by FirstRanker.com ---


2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

--- Content provided by FirstRanker.com ---


5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

--- Content provided by FirstRanker.com ---

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

--- Content provided by FirstRanker.com ---


10. What is URL?



--- Content provided by FirstRanker.com ---

Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

--- Content provided by FirstRanker.com ---


3. What is CSS?

4. Define- Style sheet.

--- Content provided by FirstRanker.com ---

5. Discuss about embedded style sheets?

6. What are the style precedence rules when using multiple approaches?

7. List down the ways of including style information in a document.

--- Content provided by FirstRanker.com ---


8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---


1. Describe about Java Scripts

2. Write about XML Elements.

--- Content provided by FirstRanker.com ---

48

3. What is XML?

4. Differentiate XML From HTML.

--- Content provided by FirstRanker.com ---


5. What is DHTML?

6. What are the form tags available in html?

--- Content provided by FirstRanker.com ---

7. What is the use of submit button?

8. What is URN?

9. What is URI?

--- Content provided by FirstRanker.com ---


10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS

--- Content provided by FirstRanker.com ---



1. What is POP3?

2. What are the steps to execute POP3?

--- Content provided by FirstRanker.com ---


3. What is FTP?

4. What is the difference between GET and POST method?

--- Content provided by FirstRanker.com ---

5. What is meant by http protocol?

6. How to make the connection with TCP?

7. Limitations of HTTP.

--- Content provided by FirstRanker.com ---


8. What is HTTP Session?

9.What is meant by loop back address?

--- Content provided by FirstRanker.com ---

10.What are the issues of next generation IP?




--- Content provided by FirstRanker.com ---

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

1. What is meant by Socket :
2. What are the two basic protocols used for transmitting the message?

--- Content provided by FirstRanker.com ---

3. What is meant by UDP?


49

--- Content provided by FirstRanker.com ---

4. What is the major difference between UDP and TCP/IP Protocol?

5. What is IP address?

6. What is OSI?

--- Content provided by FirstRanker.com ---

7. What is router?

8. What do you mean by hub?

9. What is URL?

--- Content provided by FirstRanker.com ---


10. Define packet switched networks.



--- Content provided by FirstRanker.com ---

Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

1. What is applet?

2. Explain applet life cycle?

--- Content provided by FirstRanker.com ---


3. How will you establish the connection between the servlet and an applet?

4. Can we pass parameters to an applet using
5. Compare Client and Server.

--- Content provided by FirstRanker.com ---


6. Compare swing and applet?

7. Differentiate between Servlet andApplet.

--- Content provided by FirstRanker.com ---




Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

1. What are servlets?

2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

--- Content provided by FirstRanker.com ---


4. When doPost() method of servlet to be called?

5. How to make database connection with servlet?

--- Content provided by FirstRanker.com ---

6. What is HttpSession?
7. What is CGI?

8. What are the SQL commands used for database in servlet?

--- Content provided by FirstRanker.com ---

50


9. What is tomcat server?

--- Content provided by FirstRanker.com ---

10. How sessions and cookies are used in servlet?




--- Content provided by FirstRanker.com ---



Expt.No.8: LOCKING SERVER ITSELF

1. How to read name of all filters in servlet?

--- Content provided by FirstRanker.com ---


2. What is HTTPServletRequest class?

3. What is a servlet?

--- Content provided by FirstRanker.com ---

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

6. What is URL Encoding?

--- Content provided by FirstRanker.com ---


7. When doGet() method of servlet to be called?

8. When doPost() method of servlet to be called?

--- Content provided by FirstRanker.com ---


Expt.No.: 9 SESSION TRACKING IN SERVLET

1. How to read name of all fileters in servlet?

--- Content provided by FirstRanker.com ---

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

--- Content provided by FirstRanker.com ---


5. Differentiate servlet config from servletcontext?

6. What are the phases of servlet life cycle?

--- Content provided by FirstRanker.com ---

7. What is URL Encoding?

8. When doGet() method of servlet to be called?

9. When doPost() method of servlet to be called?

--- Content provided by FirstRanker.com ---


10. What is the need for tracking session?
FirstRanker.com - FirstRanker's Choice

1

--- Content provided by FirstRanker.com ---



?


--- Content provided by FirstRanker.com ---



DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013



--- Content provided by FirstRanker.com ---





Name : ______________________________________

--- Content provided by FirstRanker.com ---

Register No. : ______________________________________
Section : ______________________________________



--- Content provided by FirstRanker.com ---

LABORATORY MANUAL

2


--- Content provided by FirstRanker.com ---



College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---


? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and
soul

--- Content provided by FirstRanker.com ---


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through
quality education and to provide enthusiastic professionals with commitment

--- Content provided by FirstRanker.com ---



? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry
? To carry out research through continuous interaction with research institutes and industry, on advances in

--- Content provided by FirstRanker.com ---

communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



VISION
VISION
MISSION

--- Content provided by FirstRanker.com ---

MISSION

2

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

--- Content provided by FirstRanker.com ---

1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex

--- Content provided by FirstRanker.com ---

software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary
skills

--- Content provided by FirstRanker.com ---

4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies
5. Lifelong Learning

--- Content provided by FirstRanker.com ---

To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





3

--- Content provided by FirstRanker.com ---


PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field
b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career

--- Content provided by FirstRanker.com ---

c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society
g) To develop a system that will meet expected need with realistic constraints such as economical,

--- Content provided by FirstRanker.com ---

environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills
j) To develop and manage projects in multidisciplinary environments

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




4

--- Content provided by FirstRanker.com ---

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



--- Content provided by FirstRanker.com ---

? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications
? Be familiar with the frameworks JSP Strut, Hibernate, Spring

--- Content provided by FirstRanker.com ---

? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.
2. Create a page for our college website.

--- Content provided by FirstRanker.com ---

3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---

b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages
1. Create a Navigation bar (with dropdown) with CSS

--- Content provided by FirstRanker.com ---

2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with
the rest of the page?

--- Content provided by FirstRanker.com ---


COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---

c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.
2. Create a XML Document for the Business Letter

--- Content provided by FirstRanker.com ---

3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.
4. Create an XML document for the student database

--- Content provided by FirstRanker.com ---

5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo

--- Content provided by FirstRanker.com ---

server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.
4. Write a simple HTTP Server-Client program in Java.

--- Content provided by FirstRanker.com ---

5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
c) Write programs in Java using Servlets:

--- Content provided by FirstRanker.com ---

i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.
2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.

--- Content provided by FirstRanker.com ---

3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---

5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in

--- Content provided by FirstRanker.com ---

a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.
4. To create the Library database.

--- Content provided by FirstRanker.com ---


e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---

f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.
4. Write a JSP program of designing Scientific Calculator.

--- Content provided by FirstRanker.com ---

5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit
card number) would be stored in web.xml. Each user should have a separate Shopping Cart

--- Content provided by FirstRanker.com ---

ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate
iii. Spring

--- Content provided by FirstRanker.com ---

b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any
consumer

--- Content provided by FirstRanker.com ---


7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---

1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.
5. Write a Program of Ajax with PHP database and displaying it.

--- Content provided by FirstRanker.com ---


WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page
b. To fix the hot spots in that map

--- Content provided by FirstRanker.com ---

c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:

--- Content provided by FirstRanker.com ---

i. HTTP request
ii. FTP
iii. SMTP
iv. POP3
b) Write a program in Java for creating simple chat application with datagram sockets and

--- Content provided by FirstRanker.com ---

datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets
h) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---

8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count
k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages

--- Content provided by FirstRanker.com ---

using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks
i. JSP Struts Framework

--- Content provided by FirstRanker.com ---

ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant
login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly

--- Content provided by FirstRanker.com ---

g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html

--- Content provided by FirstRanker.com ---

? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets
? Implement program in java to create three tier Architecture using JSP and database for Conducting

--- Content provided by FirstRanker.com ---

online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




COURSE OUTCOMES

--- Content provided by FirstRanker.com ---

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
Sl.No. Name of the Experiment Page No.

--- Content provided by FirstRanker.com ---

CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14
4. Protocols

--- Content provided by FirstRanker.com ---

a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21
CYCLE 2 - SOCKETS AND SERVLETS

--- Content provided by FirstRanker.com ---

5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27
7. Online Data Base Application Using Servlet 30

--- Content provided by FirstRanker.com ---

8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS
11. JSP Struts Framework 41

--- Content provided by FirstRanker.com ---

12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS
15.

--- Content provided by FirstRanker.com ---

Design the fields to map the location of College of Engineering
Website

16.
Design Online Quiz like Moodle Web Site

--- Content provided by FirstRanker.com ---


17.
Inventory Management System using JSP with XAMPP

18.

--- Content provided by FirstRanker.com ---

Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---



10

Expt. No.: 1 IMAGE MAPPING

--- Content provided by FirstRanker.com ---


Aim:

To create a web page with the following using HTML
(i) To embed an image map in a web page

--- Content provided by FirstRanker.com ---

(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute
3. Convert the image into map using use map attribute.

--- Content provided by FirstRanker.com ---

4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---



11


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related
Information when the hot spots are clicked using HTML(CO1) has been attained.

--- Content provided by FirstRanker.com ---



12

Applications:

--- Content provided by FirstRanker.com ---

1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

13

Expt.No.: 2 STYLE SHEETS

Aim:

--- Content provided by FirstRanker.com ---


To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---


Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---


Algorithm:

1. CSS has been added to HTML to give web developers.
2. To get more control over their design and content layout

--- Content provided by FirstRanker.com ---

3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag
7. Load each files using internet explorer.

--- Content provided by FirstRanker.com ---

Sample output:
Inline style sheet:



--- Content provided by FirstRanker.com ---



14

Embedded style sheet:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Cap.html:




--- Content provided by FirstRanker.com ---

External.html:

15


--- Content provided by FirstRanker.com ---

Caps.html:




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---

Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp
program, which takes student roll number as an input and returns the details by taking the user information from the

--- Content provided by FirstRanker.com ---

XML document

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :
a. Get the roll number of the student by using form element

--- Content provided by FirstRanker.com ---

b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().
5. Server retrieves the details from the XML file that corresponds the register number sent by the client.

--- Content provided by FirstRanker.com ---

6. Server displays the student details to the client as a response.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





17

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




Result:
Thus the program for creating the webpage with client side script validation for web forms using XML is

--- Content provided by FirstRanker.com ---

written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.
Applications:

--- Content provided by FirstRanker.com ---

1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.


--- Content provided by FirstRanker.com ---


18


Expt.No. 4.(a) : HTTP REQUEST

--- Content provided by FirstRanker.com ---


Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection
2. Set the URL AGENT as Mozilla

--- Content provided by FirstRanker.com ---

3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i
Sample output:

--- Content provided by FirstRanker.com ---

content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200
property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




19

--- Content provided by FirstRanker.com ---


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP

--- Content provided by FirstRanker.com ---

Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java
5. Files are transferred through Client to Server

--- Content provided by FirstRanker.com ---


Sample output:
F:\IP>java Main
[ MENU ]
1. Send File

--- Content provided by FirstRanker.com ---

2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3

--- Content provided by FirstRanker.com ---

F:\IP\client>java Main



20

--- Content provided by FirstRanker.com ---


[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217

--- Content provided by FirstRanker.com ---

Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...

--- Content provided by FirstRanker.com ---

Waiting for Command ...




--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





21

--- Content provided by FirstRanker.com ---


Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:

--- Content provided by FirstRanker.com ---

To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server
3. Say HELLO to the server

--- Content provided by FirstRanker.com ---

4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server
8. Read the verification of recipient from server

--- Content provided by FirstRanker.com ---

9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server
13. Close the connection

--- Content provided by FirstRanker.com ---





Sample output:

--- Content provided by FirstRanker.com ---


F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.

--- Content provided by FirstRanker.com ---



Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---




22

--- Content provided by FirstRanker.com ---

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

--- Content provided by FirstRanker.com ---


Software requirements:
Java
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail
3. Create instance for gmail properties and enable the put method

--- Content provided by FirstRanker.com ---

4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email

--- Content provided by FirstRanker.com ---

From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent

--- Content provided by FirstRanker.com ---

From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile

--- Content provided by FirstRanker.com ---

From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

Result:

--- Content provided by FirstRanker.com ---

Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the
recipients.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port
4. Get the datagram packet into a string

--- Content provided by FirstRanker.com ---

5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet
3. Get input from the user and convert the string into a datagram packet

--- Content provided by FirstRanker.com ---

4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---





25

--- Content provided by FirstRanker.com ---


Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button
2. Write a java servlet program (server.java) with the following:

--- Content provided by FirstRanker.com ---

ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()
iv. Send the response to the client by using the method of PrintWriter class

--- Content provided by FirstRanker.com ---

3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans
1. Start Netbeans IDE.Now Select File->New Project

--- Content provided by FirstRanker.com ---

2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the
code for HTML forms

--- Content provided by FirstRanker.com ---

6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After
compiling, again right click on index.jsp and select ?Run file?.

--- Content provided by FirstRanker.com ---

8. Now the browser(use firefox) will open and verify the output.

27

Sample output:

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

--- Content provided by FirstRanker.com ---


Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:
i. Define the class AppletClient which extends the property of the class Applet and implements the interface

--- Content provided by FirstRanker.com ---

ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.
v. Define the object for AppletContext and display the response from the server using the method

--- Content provided by FirstRanker.com ---

showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.
5. Click the button on the applet window in order to invoke the servlet program.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Sample output:


29

--- Content provided by FirstRanker.com ---



Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.
7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---

Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement
4. Process the results

--- Content provided by FirstRanker.com ---

5. Close the connection to the database.
Sample output:


31

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

33

Expt.No.8: LOCKING SERVER ITSELF

Aim:

--- Content provided by FirstRanker.com ---

To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.
3. This servlet has no class or instance variables associated with the locking, so as to

--- Content provided by FirstRanker.com ---

simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.
6. Get the 32-bit IP address and concatenate with the 32-bit port number.

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



34

Sample output:

--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture
using JSP and database for conducting online examination and for displaying student mark list for

--- Content provided by FirstRanker.com ---

the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15
minutes and so on.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml

--- Content provided by FirstRanker.com ---

4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

Result:

--- Content provided by FirstRanker.com ---

Thus a servlet program using HTTP Servlet is created and executed successfully.

36

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:
1. Display the web page details of Every Web Site's Home Page (College).

--- Content provided by FirstRanker.com ---

2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.

--- Content provided by FirstRanker.com ---

2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---

38




--- Content provided by FirstRanker.com ---


Result:
Thus the sessions servlet and cookie servlet was executed successfully.

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages
i. Creating a Login Page

--- Content provided by FirstRanker.com ---

ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation
i. Accessing Bean Data and Preparing a Forwarding Condition

--- Content provided by FirstRanker.com ---

ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet

--- Content provided by FirstRanker.com ---

iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.

--- Content provided by FirstRanker.com ---

Password: admin.


40

--- Content provided by FirstRanker.com ---


Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





41

--- Content provided by FirstRanker.com ---


Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

--- Content provided by FirstRanker.com ---


Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.
4. Create controller by extending SimpleForm Controller.

--- Content provided by FirstRanker.com ---

5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:

--- Content provided by FirstRanker.com ---

Login page
User Name:
GEETHA

password:

--- Content provided by FirstRanker.com ---

*****

Login


--- Content provided by FirstRanker.com ---

New User?Register

Hello World! from main page


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the spring application was executed successfully.

42

Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

Applications:
1. Data access in Spring Framework.

--- Content provided by FirstRanker.com ---

2. ERP
3. Spring Boot



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





43

--- Content provided by FirstRanker.com ---


Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.
5. Display the contents of requested file.

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---




44

--- Content provided by FirstRanker.com ---

Result:
Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



45

Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

--- Content provided by FirstRanker.com ---


Aim:
To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is
searching for an airline using Web Services and Data base
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:
1. Define the service's interface. This is done with WSDL

--- Content provided by FirstRanker.com ---

2. Implement the service. This is done with Java
3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done with Ant
5. Deploy service. This is also done with a GT4 tool

--- Content provided by FirstRanker.com ---


Sample output:



--- Content provided by FirstRanker.com ---


46



--- Content provided by FirstRanker.com ---

Result:
Thus the program to develop the scenario of two web Services- an airline service and travel agent is
searching for an airline using Web Services and Data base is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





47

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

2. What are the various types of lists?

--- Content provided by FirstRanker.com ---


3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

--- Content provided by FirstRanker.com ---


6. Can you list out the linking tags in HTML?

7. Define ? HTML

--- Content provided by FirstRanker.com ---

8. Write the syntax of href?

9. Compare HTML and XHTML.

10. What is URL?

--- Content provided by FirstRanker.com ---




Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

--- Content provided by FirstRanker.com ---


4. Define- Style sheet.

5. Discuss about embedded style sheets?

--- Content provided by FirstRanker.com ---

6. What are the style precedence rules when using multiple approaches?

7. List down the ways of including style information in a document.

8. Define cascading.

--- Content provided by FirstRanker.com ---



Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

--- Content provided by FirstRanker.com ---


2. Write about XML Elements.

48

--- Content provided by FirstRanker.com ---

3. What is XML?

4. Differentiate XML From HTML.

5. What is DHTML?

--- Content provided by FirstRanker.com ---


6. What are the form tags available in html?

7. What is the use of submit button?

--- Content provided by FirstRanker.com ---

8. What is URN?

9. What is URI?

10. Differentiate client side scripting from server side scripting.

--- Content provided by FirstRanker.com ---



Expt.No. 4: PROTOCOLS


--- Content provided by FirstRanker.com ---

1. What is POP3?

2. What are the steps to execute POP3?

3. What is FTP?

--- Content provided by FirstRanker.com ---


4. What is the difference between GET and POST method?

5. What is meant by http protocol?

--- Content provided by FirstRanker.com ---

6. How to make the connection with TCP?

7. Limitations of HTTP.

8. What is HTTP Session?

--- Content provided by FirstRanker.com ---


9.What is meant by loop back address?

10.What are the issues of next generation IP?

--- Content provided by FirstRanker.com ---




Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---

1. What is meant by Socket :
2. What are the two basic protocols used for transmitting the message?

3. What is meant by UDP?

--- Content provided by FirstRanker.com ---


49

4. What is the major difference between UDP and TCP/IP Protocol?

--- Content provided by FirstRanker.com ---

5. What is IP address?

6. What is OSI?
7. What is router?

--- Content provided by FirstRanker.com ---

8. What do you mean by hub?

9. What is URL?

10. Define packet switched networks.

--- Content provided by FirstRanker.com ---




Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

--- Content provided by FirstRanker.com ---

1. What is applet?

2. Explain applet life cycle?

3. How will you establish the connection between the servlet and an applet?

--- Content provided by FirstRanker.com ---


4. Can we pass parameters to an applet using
5. Compare Client and Server.

6. Compare swing and applet?

--- Content provided by FirstRanker.com ---


7. Differentiate between Servlet andApplet.



--- Content provided by FirstRanker.com ---


Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

1. What are servlets?

--- Content provided by FirstRanker.com ---

2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

4. When doPost() method of servlet to be called?

--- Content provided by FirstRanker.com ---


5. How to make database connection with servlet?

6. What is HttpSession?
7. What is CGI?

--- Content provided by FirstRanker.com ---


8. What are the SQL commands used for database in servlet?

50

--- Content provided by FirstRanker.com ---


9. What is tomcat server?

10. How sessions and cookies are used in servlet?

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Expt.No.8: LOCKING SERVER ITSELF

1. How to read name of all filters in servlet?

2. What is HTTPServletRequest class?

--- Content provided by FirstRanker.com ---


3. What is a servlet?

4. What are common tasks performed by servlet container?

--- Content provided by FirstRanker.com ---

5. Differentiate servlet config from servletcontext?

6. What is URL Encoding?

7. When doGet() method of servlet to be called?

--- Content provided by FirstRanker.com ---


8. When doPost() method of servlet to be called?


Expt.No.: 9 SESSION TRACKING IN SERVLET

--- Content provided by FirstRanker.com ---


1. How to read name of all fileters in servlet?

2. What is HTTPServletRequest class?

--- Content provided by FirstRanker.com ---

3. What is a servlet?

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

--- Content provided by FirstRanker.com ---


6. What are the phases of servlet life cycle?

7. What is URL Encoding?

--- Content provided by FirstRanker.com ---

8. When doGet() method of servlet to be called?

9. When doPost() method of servlet to be called?

10. What is the need for tracking session?

--- Content provided by FirstRanker.com ---


51



--- Content provided by FirstRanker.com ---


Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

1. What are cookies?

--- Content provided by FirstRanker.com ---

2. How to create a cookie using servlet?

3. How to read a cookie using servlet?

4. How do we get the database connection with servlet?

--- Content provided by FirstRanker.com ---


5. What are the uses of Servlet?

6. What is the use of servlet wrapper class?

--- Content provided by FirstRanker.com ---

7. What do you mean byJDBC?

8. Define ODBC.

9. List down the ways ODBC differ fromJDBC?

--- Content provided by FirstRanker.com ---


10. List down the types of drivers available in JDBC.


Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---



1. What are the main components in struts application?

2. Why we use Struts?

--- Content provided by FirstRanker.com ---


3. What is strut?

4. What are the components of struts?

--- Content provided by FirstRanker.com ---

Expt.No.12 SPRING FRAMEWORK

1. What is Spring Framework?

2. What are some of the important features and advantages of Spring Framework?

--- Content provided by FirstRanker.com ---


3. Name some of the important Spring Modules?

4. What is spring?

--- Content provided by FirstRanker.com ---

5. What is spring IOC container?

6. What are spring beans?
FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---

1


?

--- Content provided by FirstRanker.com ---




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________


--- Content provided by FirstRanker.com ---


LABORATORY MANUAL

2

--- Content provided by FirstRanker.com ---




College of Engineering is committed to provide highly disciplined, conscientious and
enterprising professionals conforming to global standards through value based quality education and training.

--- Content provided by FirstRanker.com ---



? To provide competent technical manpower capable of meeting requirements of the industry
? To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
? To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and

--- Content provided by FirstRanker.com ---

soul

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

To strive for acquiring, applying and imparting knowledge in Computer Science and Engineering through

--- Content provided by FirstRanker.com ---

quality education and to provide enthusiastic professionals with commitment


? To educate the students with the state-of-art technologies to meet the growing challenges of the electronics
industry

--- Content provided by FirstRanker.com ---

? To carry out research through continuous interaction with research institutes and industry, on advances in
communication systems
? To provide the students with strong ground rules to facilitate them for systematic learning, innovation and
ethical practices

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




VISION
VISION

--- Content provided by FirstRanker.com ---

MISSION
MISSION

2

--- Content provided by FirstRanker.com ---

ROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering
that will would them to be successful professionals
2. Core Competence

--- Content provided by FirstRanker.com ---

To provide students with sound knowledge in engineering and experimental skills to identify complex
software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to
find solutions for real time problem in industry and organization and to design products requiring interdisciplinary

--- Content provided by FirstRanker.com ---

skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their
communication skills, individual leadership and supportive qualities and to develop them to adapt and work in
ever changing technologies

--- Content provided by FirstRanker.com ---

5. Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and
Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

3

PROGRAMME OUTCOMES (POs)
a) To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and
Engineering field

--- Content provided by FirstRanker.com ---

b) To design and conduct experiments as well as to analyze and interpret and apply the same in the career
c) To design and develop innovative and creative software applications
d) To understand a complex real world problems and develop an efficient practical solutions
e) To create, select and apply appropriate technique, resources, modern engineering and IT tools
f) To understand their roles as professionals and give the best to the society

--- Content provided by FirstRanker.com ---

g) To develop a system that will meet expected need with realistic constraints such as economical,
environmental, social, political, ethical, safe and sustainable
h) To communicate effectively and make others understand exactly what they are trying to convey in both verbal
and written forms
i) To engage lifelong learning and exhibit their technical skills

--- Content provided by FirstRanker.com ---

j) To develop and manage projects in multidisciplinary environments




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





4

--- Content provided by FirstRanker.com ---


CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS


--- Content provided by FirstRanker.com ---


? Be familiar with Web page design using HTML/XML and style sheets
? Be exposed to creation of user interfaces using Java frames and applets
? Learn to create dynamic web pages using server side scripting.
? Learn to write Client Server applications

--- Content provided by FirstRanker.com ---

? Be familiar with the frameworks JSP Strut, Hibernate, Spring
? Be exposed to creating applications with AJAX
LIST OF EXPERIMENTS:
WEBPAGE CONCEPTS
a) Create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

a. To embed a map in a web page
b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
1. Create a page with a link at the top of it that when clicked will jump all the way to the bottom of the page. At the bottom
of the page there should be a link to jump back to the top of the page.

--- Content provided by FirstRanker.com ---

2. Create a page for our college website.
3. Display an image that when clicked will link to itself and will display the image in the browser by itself.
4. Display five different images. Skip two lines between each image. Each image should have a title.
5. Print a paragraph that is a description of a book, include the title of the book as well as its author. Names and titles
should be underlined, adjectives should be italicized and bolded.

--- Content provided by FirstRanker.com ---


b) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets
c. Inline style sheets. Use our college information for the web pages

--- Content provided by FirstRanker.com ---

1. Create a Navigation bar (with dropdown) with CSS
2. Create a CSS3 based Zebra striped table
3. Create a Symposium Registration / Feedback Form
4. Create a page our college information for the web page using CSS types
5. Create a page of How to set the background-attachment property whether a background image is fixed or scrolls with

--- Content provided by FirstRanker.com ---

the rest of the page?

COURSE OBJECTIVES

5

--- Content provided by FirstRanker.com ---


c) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user
information from the XML document.
1. Create and save an XML document to view an food menu.

--- Content provided by FirstRanker.com ---

2. Create a XML Document for the Business Letter
3. A business has a telephone directory that records the first and last name, telephone number and email address
of everyone working in the firm. Departments are the main organizing unit of the firm so the telephone directory is
typically displayed in department order and shows for each department the contact phone and fax number and
email address.

--- Content provided by FirstRanker.com ---

4. Create an XML document for the student database
5. Create an XML schema to describe a museum (use elements of the museum entity defined in the last chapter,
and add to it a country element). Specify a set of acceptable values as a country and its calendar with date,
opening time, and closing time.
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

a) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

1. Write a Java program of creating a simple SMTP (simple mail transfer protocol) client, and a simple echo
server for communication.
2. Write a Java program of Greeting Client is a client program that connects to a server by using a socket and
sends a greeting, and then waits for a response.
3. Write a Java program of file transfer from local to remote.

--- Content provided by FirstRanker.com ---

4. Write a simple HTTP Server-Client program in Java.
5. Write a Java program of how to send an HTTP POST request with a Socket. A socket is an endpoint for
communication between two machines. Sending an HTTP POST request using a Socket.
b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets

--- Content provided by FirstRanker.com ---

c) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
ii. To invoke servlets from Applets

1. Write a Java Servlet program of creating a simple counter.

--- Content provided by FirstRanker.com ---

2. Write a Java Servlet program of Creating a Login page with parameter passing into the server.
3. Write a Java Servlet shows a servlet that uses client pull to display the current time, updated every 10 seconds.
4. Write a Java Servlet generates and returns a GIF image. The graphic says "Hello World!"

6

--- Content provided by FirstRanker.com ---


5. Write a Java Servlet uses session tracking to count the number of times a client has accessed it. The servlet also
displays all the bindings for the current session, just because it can.

d) Write programs in Java to create three-tier applications using servlets for conducting on-line

--- Content provided by FirstRanker.com ---

examination for displaying student mark list. Assume that student information is available in
a database which has been stored in a database server.
1. To create the Employees table in TEST database for online quiz.
2. To create the login database and access it through online link.
3. To create the Students database for their mark list.

--- Content provided by FirstRanker.com ---

4. To create the Library database.

e) Write a program to lock servlet itself to a particular server IP address and port number. It
requires an init parameter key that is appropriate for its servlet IP address and port before it
unlocks itself and handles a request.

--- Content provided by FirstRanker.com ---


f) Session tracking using hidden form fields and Session tracking for a hit count
1. To create the validation on the login form using Javascript method in JSP page.
2. Session Tracking using JSP.
3. Session Tracking using Servlet.

--- Content provided by FirstRanker.com ---

4. Write a JSP program of designing Scientific Calculator.
5. Write a JSP program of displaying cookies information.

g) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web
pages using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit

--- Content provided by FirstRanker.com ---

card number) would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
a) Implement a simple program using following frameworks
i. JSP Struts Framework
ii. Hibernate

--- Content provided by FirstRanker.com ---

iii. Spring
b) Explore the following application in AJAX: Searching in real time with live searches, Getting
the answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax,
Getting instant login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
c) Write a web services for finding what people think by asking 500 people?s opinion for any

--- Content provided by FirstRanker.com ---

consumer

7

d) Write a web services for predicting for any product sales

--- Content provided by FirstRanker.com ---


1. Write a hello world program of AJAX JQuery.
2. Write a calculator program of JSP Struts.
3. Create, Publish and Displaying a web service of product sales.
4. To display a message through Spring MVC framework.

--- Content provided by FirstRanker.com ---

5. Write a Program of Ajax with PHP database and displaying it.

WEBPAGE CONCEPTS
d) Create a web page with the following using HTML
a. To embed a map in a web page

--- Content provided by FirstRanker.com ---

b. To fix the hot spots in that map
c. Show all the related information when the hot spots are clicked
e) Create a web page with the following:
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages
f) Create and save an XML document at the server, which contains 10 users Information. Write a
Program, which takes user Id as an input and returns the User details by taking the user information
from the XML document
SOCKETS & SERVLETS

--- Content provided by FirstRanker.com ---

b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
iii. SMTP
iv. POP3

--- Content provided by FirstRanker.com ---

b) Write a program in Java for creating simple chat application with datagram sockets and
datagram packets
d) Write programs in Java using Servlets:
i. To invoke servlets from HTML forms
iii. To invoke servlets from Applets

--- Content provided by FirstRanker.com ---

h) Write programs in Java to create three-tier applications using servlets for conducting on-line
examination for displaying student mark list. Assume that student information is available in a
database which has been stored in a database server
i) Write a program to lock servlet itself to a particular server IP address and port number. It requires an
init parameter key that is appropriate for its servlet IP address and port before it unlocks itself and

--- Content provided by FirstRanker.com ---


8

handles a request
j) Session tracking using hidden form fields and Session tracking for a hit count

--- Content provided by FirstRanker.com ---

k) Install TOMCAT web server. Convert the static webpages of programs 1&2 into dynamic web pages
using servlets (or JSP) and cookies. Hint: Users information (user id, password, credit card number)
would be stored in web.xml. Each user should have a separate Shopping Cart
ADVANCE CONCEPTS:
e) Implement a simple program using following frameworks

--- Content provided by FirstRanker.com ---

i. JSP Struts Framework
ii. Hibernate
iii. Spring
f) Explore the following application in AJAX: Searching in real time with live searches, Getting the
answer with auto complete, Chatting with friends ,Dragging and dropping with Ajax, Getting instant

--- Content provided by FirstRanker.com ---

login feedback, Ajax-enabled popup menus, Modifying Web pages on the fly
g) Write a web services for finding what people think by asking 500 people?s opinion for any consumer
h) Write a web services for predicting for any product sales


--- Content provided by FirstRanker.com ---

? Create webpage to embed an image map, fix the hot spot, show all the information in hot spots in html
? Create a webpage with all type of cascading style sheets
? Create a client side scripts for validating web form controls using DHTML/XML
? Create a java program using protocol (HTTP/SMTP/FTP/POP3)
? Create a java program using applet and implementation in java to invoke servlets from HTML/ Applets

--- Content provided by FirstRanker.com ---

? Implement program in java to create three tier Architecture using JSP and database for Conducting
online examination and also displaying student mark list for the student
? Session and Cookies information available in the server which is stored in JSP and Servlet
? Implement program using XML ? schema ? XSLT/XSL
? Implement a program using AJAX, Spring, Struts and Web services

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---





COURSE OUTCOMES

--- Content provided by FirstRanker.com ---


9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS

--- Content provided by FirstRanker.com ---

Sl.No. Name of the Experiment Page No.
CYCLE 1 - WEB PAGE CONCEPTS
1. Image Mapping 7
2. Style Sheets 10
3. Web Form Validation of Xml Using Java Script 14

--- Content provided by FirstRanker.com ---

4. Protocols
a) Http Request 17
b) FTP-File Transfer Protocol 18
c) SMTP- Simple Mail Transfer Protocol 20
d) POP3- Post Office Protocol 21

--- Content provided by FirstRanker.com ---

CYCLE 2 - SOCKETS AND SERVLETS
5. Chat Application Using UDP 23
6. Invoking Servlets
a) Invoke Servlets From Html 25
b) Invoke Servlets From Applets 27

--- Content provided by FirstRanker.com ---

7. Online Data Base Application Using Servlet 30
8. Locking Server Itself 33
9. Session Tracking In Servlets 36
10. Sessions and Cookies In Servlet 38
CYCLE 3 - ADVANCE CONCEPTS

--- Content provided by FirstRanker.com ---

11. JSP Struts Framework 41
12. Spring Framework 43
13. Ajax Application 45
14. Airline Reservation System Using Web Services 47
MINI PROJECTS

--- Content provided by FirstRanker.com ---

15.
Design the fields to map the location of College of Engineering
Website

16.

--- Content provided by FirstRanker.com ---

Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

--- Content provided by FirstRanker.com ---

18.
Design a Website of displaying contents in a Book using PHP with XAMPP

19.
Design and Implement a Library Management System

--- Content provided by FirstRanker.com ---




10

--- Content provided by FirstRanker.com ---

Expt. No.: 1 IMAGE MAPPING

Aim:

To create a web page with the following using HTML

--- Content provided by FirstRanker.com ---

(i) To embed an image map in a web page
(ii) To fix the hot spots
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Develop a web page, india.html and insert india map image using tag.
2. Create a image map using element and fix appropriate hot spots using attribute

--- Content provided by FirstRanker.com ---

3. Convert the image into map using use map attribute.
4. Develop appropriate pages for each hot spot.
5. Load the india.html page using internet explorer.

Sample output:

--- Content provided by FirstRanker.com ---




11

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Result:
Thus the program of creating webpage with image mapping is written and executed successfully.
Outcome:
Thus the outcome of creating webpage to embed an image map, fix the hot spot, show all the related

--- Content provided by FirstRanker.com ---

Information when the hot spots are clicked using HTML(CO1) has been attained.


12

--- Content provided by FirstRanker.com ---

Applications:
1. Web Site Designing of College, Online Editor, Front page of Gmail and Twitter
2. Creating Web Apps like OLA App, HDFC App.
3. Designing of Personal Web site like GoDaddy, Wedding Site

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


13

Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---

Aim:

To create a web page with the following
a. Cascading style sheets
b. Embedded style sheets

--- Content provided by FirstRanker.com ---

c. Inline style sheets. Use our college information for the web pages

Software requirements:
Internet Explorer
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS

Algorithm:

1. CSS has been added to HTML to give web developers.

--- Content provided by FirstRanker.com ---

2. To get more control over their design and content layout
3. To create a standard set of commands to control the styles of all the subsequent pages
4. Web site designed in the CSS are faster to change and update.
5. Communication among multiple developers easier with CSSext.css & define a styles.
6. Then link the html file and css file using tag

--- Content provided by FirstRanker.com ---

7. Load each files using internet explorer.
Sample output:
Inline style sheet:


--- Content provided by FirstRanker.com ---




14

--- Content provided by FirstRanker.com ---

Embedded style sheet:




--- Content provided by FirstRanker.com ---


Cap.html:



--- Content provided by FirstRanker.com ---


External.html:

15

--- Content provided by FirstRanker.com ---


Caps.html:



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



Result:
Thus the program for creating the website with college information using internal and external cascading style
sheets is written and executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the outcome of creating a webpage with all type of cascading style sheets (CO2) has been attained.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.

16

--- Content provided by FirstRanker.com ---


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

Aim :
To Create and save an XML document at the server which contains 10 Student?s results. And also write a jsp

--- Content provided by FirstRanker.com ---

program, which takes student roll number as an input and returns the details by taking the user information from the
XML document

Software requirements:
Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Create the XML file and store 10 students results.
2. Design the HTML page with the following :

--- Content provided by FirstRanker.com ---

a. Get the roll number of the student by using form element
b. Set the URL of the server as the value of the action attribute
3. Submit the form data to the server.
4. Server read the parameter value (register number) from the form by using the method get
Parameter().

--- Content provided by FirstRanker.com ---

5. Server retrieves the details from the XML file that corresponds the register number sent by the client.
6. Server displays the student details to the client as a response.



--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

17

Sample output:


--- Content provided by FirstRanker.com ---





Result:

--- Content provided by FirstRanker.com ---

Thus the program for creating the webpage with client side script validation for web forms using XML is
written and executed successfully.
Outcome:
Thus the course outcome of creating a client side scripts for validating web form controls using DHTML/XML
(CO3) has been attained.

--- Content provided by FirstRanker.com ---

Applications:
1. Designing web site validation like Enrollment form of NPTEL, Admission Registration of
TNEA.
2. Designing web site validation of Registration and Feedback Queries of Web Sites.

--- Content provided by FirstRanker.com ---



18


--- Content provided by FirstRanker.com ---

Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:

--- Content provided by FirstRanker.com ---

Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS
Algorithm:
1. Import the package HttpUrlConnection

--- Content provided by FirstRanker.com ---

2. Set the URL AGENT as Mozilla
3. Create 2 methods send Get and send Post
4. Declare the 2 URL for send the request
5. Set the Request Method as post and properties user agent and accept language
6. Read the content of URL and print i

--- Content provided by FirstRanker.com ---

Sample output:
content="/logos/doodles/2015/annie- besants-168th-birthday-5735648329728000-hp.jpg"
itemprop="image">Testing 1 - Send Http GET request
Sending 'GET' request to URL : http://www.google.com/
Response Code : 200

--- Content provided by FirstRanker.com ---

property="og:description">BUILD SUCCESSFUL (total time: 3 seconds)


Result:
Thus the java program using sockets to implement the http request messages has been executed

--- Content provided by FirstRanker.com ---

successfully.




--- Content provided by FirstRanker.com ---





19

--- Content provided by FirstRanker.com ---



Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
Any Window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Develop java programs to send and receive files through FTP
2. Instantiate the connection between the FTP Client and FTP Server using Sockets
3. If the connection is over by using GET and SET method
4. Files are read and written through corresponding readers in java

--- Content provided by FirstRanker.com ---

5. Files are transferred through Client to Server

Sample output:
F:\IP>java Main
[ MENU ]

--- Content provided by FirstRanker.com ---

1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java

--- Content provided by FirstRanker.com ---

File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit

--- Content provided by FirstRanker.com ---

Enter Choice :3
F:\IP\client>java Main



--- Content provided by FirstRanker.com ---

20

[ MENU ]
1. Send File
2. Receive File

--- Content provided by FirstRanker.com ---

3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully

--- Content provided by FirstRanker.com ---

[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server

--- Content provided by FirstRanker.com ---

FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...

--- Content provided by FirstRanker.com ---

GET Command Received ...
Waiting for Command ...



--- Content provided by FirstRanker.com ---


Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


--- Content provided by FirstRanker.com ---

Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any Window OS
Algorithm:
1. Import all necessary packages and to establish a connection with the server
2. Read the acceptance from the server

--- Content provided by FirstRanker.com ---

3. Say HELLO to the server
4. Read the greeting from the server
5. Send sender address to server
6. Read the verification of sender from server
7. Send recipient address to server

--- Content provided by FirstRanker.com ---

8. Read the verification of recipient from server
9. Send DATA command to the server Steps
10. Read the start indication from server
11. Send the message to the server
12. Read the acceptance of message from server

--- Content provided by FirstRanker.com ---

13. Close the connection




--- Content provided by FirstRanker.com ---

Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp

--- Content provided by FirstRanker.com ---

Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed

--- Content provided by FirstRanker.com ---

successfully.



22

--- Content provided by FirstRanker.com ---


Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

--- Content provided by FirstRanker.com ---

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any Window OS
Algorithm:
1. Include javax mailpackage in netbeans
2. Save javax mail in folder.right click the libraries of pops project, select add jar/folder ,then select the javax
mail

--- Content provided by FirstRanker.com ---

3. Create instance for gmail properties and enable the put method
4. Create instance for Session and Message
5. Set the less security for particular Gmail id by using the URL
www.google.com/settings/security/lesssecureapps
6. Read the form, to address and content

--- Content provided by FirstRanker.com ---


Sample output:
messages.length---298
---------------------------------
Email Number 1

--- Content provided by FirstRanker.com ---

Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2

--- Content provided by FirstRanker.com ---

Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3

--- Content provided by FirstRanker.com ---

Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

--- Content provided by FirstRanker.com ---

Result:
Thus the java program using sockets to implement the POP3 protocol messages has been executed
successfully.
Outcome:
Thus the outcome of creating a java program using protocol (HTTP/SMTP/FTP/POP3) (CO4) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Designing Web Sites of Career Registration, Uploading of SSR in NAAC, Downloading files
like Syllabus, Question bank of any education websites.
2. Designing of Web Sites like any Compose Mail, Forward Mail and Reply Mail to the

--- Content provided by FirstRanker.com ---

recipients.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---



Aim:

To write a java program to create a simple chat application with datagram sockets

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---


Server Side
1. Import net and io packages and class
2. Create a datagram socket an datagram packet
3. While client send datagram packet to server listen to client port

--- Content provided by FirstRanker.com ---

4. Get the datagram packet into a string
5. Display the string
Client Side
1. Import net and io packages
2. Create a datagram socket and datagram packet

--- Content provided by FirstRanker.com ---

3. Get input from the user and convert the string into a datagram packet
4. send the datagram packet to the server through serve port

Sample output:

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you

--- Content provided by FirstRanker.com ---

F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

25

Result:
Thus the program for implementing simple chat application using UDP has been executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of creating a java program using protocol ?UDP (CO4) has been
attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

--- Content provided by FirstRanker.com ---


Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Write a client side HTML program (client.html) with the following:
i. Insert a that contains the fields such as text, password and one submit button

--- Content provided by FirstRanker.com ---

2. Write a java servlet program (server.java) with the following:
ii. Define a class server that extends the property of the class GenericServlet
iii. Handle the request from the client by using the method service() of GenericServlet class. Get the
parameter names from the HTML form by using the method getParameterNames() Get the parameter
values from the HTML forms by using the method getParameter()

--- Content provided by FirstRanker.com ---

iv. Send the response to the client by using the method of PrintWriter class
3. Compile the java source code (server.java).
4. Run the HTML program (client.html).
5. Submit the form data to the server.
Procedure to run this program on Netbeans

--- Content provided by FirstRanker.com ---

1. Start Netbeans IDE.Now Select File->New Project
2. In the New Project Dialog box that appears select Java Web(Web Application).
3. Now ?New Web Application? Dialog box appears
4. Give the Project Name as ?ServletApplication?. Click Next twice and then Finish.
5. Now a web application named ServletApplication is created with a default page ?index.jsp?. There write the

--- Content provided by FirstRanker.com ---

code for HTML forms
6. Then right click on the WEB-INF folder and select New-> Servlet. Give the name of the servlet as ?MyServlet?
, click Next. In the next dialog that appears please make sure ?Add information to deployment descriptor?
checkbox is selected. Now click next and then finish
7. Write the code for Servlet in it.To compile the file, right click on index.jsp and then select ?compile After

--- Content provided by FirstRanker.com ---

compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---


.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

--- Content provided by FirstRanker.com ---

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
1. Write a java applet program (AppletClient.java) with the following:

--- Content provided by FirstRanker.com ---

i. Define the class AppletClient which extends the property of the class Applet and implements the interface
ActionListener.
ii. Define the objects for Button and add the button in the init() method of Applet class.
iii. Make the button to listen the action by using the method addActionListener().
iv. Set the URL of the servlet program by using the object of the class URL.

--- Content provided by FirstRanker.com ---

v. Define the object for AppletContext and display the response from the server using the method
showDocument().
2. Create an HTML file (AppletClient.html) that contains the applet tag and pass the class name to applet
3. Write a simple servlet program (MyServer.java) that contains any response message.
4. Run the HTML file (AppletClient.html) that contains the corresponding applet code.

--- Content provided by FirstRanker.com ---

5. Click the button on the applet window in order to invoke the servlet program.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Sample output:


29

--- Content provided by FirstRanker.com ---




Result:
Thus the program for invokes the servlet from applets is written and executed successfully.

--- Content provided by FirstRanker.com ---


Outcome:
Thus the course outcome of creating a java program using applet and also implement program in java to invoke
servlets from HTML forms and applets (CO5) has been attained.

--- Content provided by FirstRanker.com ---

Applications:

1. Design and implement web pages like Online Editor and Online Compiler to execute programs.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



30

Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

--- Content provided by FirstRanker.com ---

Aim:
To create an online database application using JDBC-ODBC with Servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for

--- Content provided by FirstRanker.com ---

apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Create a database with proper fields in a table.
6. Make a connection with database through dsn and database of.mdb file.

--- Content provided by FirstRanker.com ---

7. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Connection through Servlet with JDBC-ODBC
1. Create an JDBC-ODBC connection to a database
2. Open the database connection
3. Execute a SQL statement

--- Content provided by FirstRanker.com ---

4. Process the results
5. Close the connection to the database.
Sample output:


--- Content provided by FirstRanker.com ---

31




--- Content provided by FirstRanker.com ---

Result:
Thus the online application of servlet using database was executed successfully.
Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture using JSP database
for conducting online examination and for displaying student mark list for the student (CO6) has been attained.

--- Content provided by FirstRanker.com ---


Applications:
1. Design and Implement a Library Management System.

32

--- Content provided by FirstRanker.com ---


2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


33

Expt.No.8: LOCKING SERVER ITSELF

--- Content provided by FirstRanker.com ---

Aim:
To create a servlet program locks itself to a particular server IP address and port number
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. A Servlet locks itself to a particular server ip address and port number.
2. It requires an init parameter key that is appropriate for its server IP address and port before it unlocks itself
and handles a request.

--- Content provided by FirstRanker.com ---

3. This servlet has no class or instance variables associated with the locking, so as to
simplify synchronization issues.
4. It contains the algorithm used to match a key with a server host and port.
5. The key must be a 64-bit number equal to the logical not (~)of the 32-bit IP address
Concatenated with the 32-bit port number.

--- Content provided by FirstRanker.com ---

6. Get the 32-bit IP address and concatenate with the 32-bit port number.
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




34

--- Content provided by FirstRanker.com ---

Sample output:




--- Content provided by FirstRanker.com ---

Result:
Thus the servlet program of lock server itself was executed successfully.

Outcome:
Thus the course outcome of implementing program in java to create three tiers Architecture

--- Content provided by FirstRanker.com ---

using JSP and database for conducting online examination and for displaying student mark list for
the student (CO6) has been attained.

Applications:
1. Designing a Web page like locked a system within 10 minutes, switch user locking by 15

--- Content provided by FirstRanker.com ---

minutes and so on.




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:

--- Content provided by FirstRanker.com ---

To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
The General steps to follow in order to run a servlet are:
1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )

--- Content provided by FirstRanker.com ---

3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server
5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)
Sample output:

--- Content provided by FirstRanker.com ---

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

36

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP
and Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Display the web page details of Every Web Site's Home Page (College).
2. Check the valid users of Web sites like designing notification mail to personal id in Bank.
3. Designing a web page to display number of times visited the same web page.


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




37

--- Content provided by FirstRanker.com ---

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:

--- Content provided by FirstRanker.com ---

Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
The General steps to follow in order to run a servlet are:

--- Content provided by FirstRanker.com ---

1. Compile the servlet program using an appropriate compiler version.
2. Copy the resulting .class file to the appropriate directory for your Java-servlet capable web server. (for
apache we need to store the .class file in webapps/webinf/classes )
3. Now we need to link the servlet class file with the server by using web.xml
4. Start / Restart the apache server

--- Content provided by FirstRanker.com ---

5. Navigate to the URL corresponding to your servlet.(http://localhost:8080/filename)

Sample output:


--- Content provided by FirstRanker.com ---


38



--- Content provided by FirstRanker.com ---



Result:
Thus the sessions servlet and cookie servlet was executed successfully.

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of Session and Cookies information available in the server which is stored in JSP and
Servlet (CO6) has been attained.

Applications:

--- Content provided by FirstRanker.com ---


1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---



39

Expt.No.11: JSP STRUTS FRAMEWORK

--- Content provided by FirstRanker.com ---


Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server

--- Content provided by FirstRanker.com ---

Hardware requirements:
Any window OS
Algorithm:
1. Setting Up a Struts Application
2. Creating JSP Pages

--- Content provided by FirstRanker.com ---

i. Creating a Login Page
ii. Creating a Success Page
3. Creating an Action Form Bean
4. Creating an Action Class
5. Implementing Validation

--- Content provided by FirstRanker.com ---

i. Accessing Bean Data and Preparing a Forwarding Condition
ii. Setting Up an Error Message
6. Adding forward Entries to struts-config.xml
7. Configuring and Running the Application
i. Setting the Welcome Page

--- Content provided by FirstRanker.com ---

ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure

--- Content provided by FirstRanker.com ---

E-mail: admin@yahoo.co.in.
Password: admin.


40

--- Content provided by FirstRanker.com ---



Result:
Thus the development of struts application is validated and implemented successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting

--- Content provided by FirstRanker.com ---

3. Displaying of E-Books




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

41

Expt.No.12 SPRING FRAMEWORK

Aim:

--- Content provided by FirstRanker.com ---

To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:

--- Content provided by FirstRanker.com ---

Any window OS
Algorithm:
1. Create web project and spring frame work.
2. Configure dispatcher servlet.
3. Create form beans/Domain objects.

--- Content provided by FirstRanker.com ---

4. Create controller by extending SimpleForm Controller.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

--- Content provided by FirstRanker.com ---

Sample output:
Login page
User Name:
GEETHA

--- Content provided by FirstRanker.com ---

password:
*****

Login

--- Content provided by FirstRanker.com ---


New User?Register

Hello World! from main page

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

Result:
Thus the spring application was executed successfully.

42

--- Content provided by FirstRanker.com ---

Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.

Applications:

--- Content provided by FirstRanker.com ---

1. Data access in Spring Framework.
2. ERP
3. Spring Boot


--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

43

Expt.No. 13: PROGRAM USING AJAX

Aim:

--- Content provided by FirstRanker.com ---

To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS

--- Content provided by FirstRanker.com ---

Algorithm:
1. Use JavaScript to initialize the XML HTML request object.
2. Use HTML to create areas for user input and output.
3. Use JavaScript to send the user inputs to a server.
4. Process the data on a server use JavaScript to process any response from the server.

--- Content provided by FirstRanker.com ---

5. Display the contents of requested file.

Sample output:


--- Content provided by FirstRanker.com ---





44

--- Content provided by FirstRanker.com ---


Result:
Thus the program for demonstrating Ajax is written and executed successfully.
Outcome:
Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has

--- Content provided by FirstRanker.com ---

been attained.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---




45

--- Content provided by FirstRanker.com ---

Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

Aim:
To develop the scenario of two web Services- an airline service and a travel agent and the travel agent is
searching for an airline using Web Services and Data base

--- Content provided by FirstRanker.com ---

Software requirements:
Jdk 7, Internet Explorer
Hardware requirements:
Any window OS
Algorithm:

--- Content provided by FirstRanker.com ---

1. Define the service's interface. This is done with WSDL
2. Implement the service. This is done with Java
3. Define the deployment parameters. This is done with WSDD and JNDI
4. Compile everything and generate a GAR file. This is done with Ant
5. Deploy service. This is also done with a GT4 tool

--- Content provided by FirstRanker.com ---



Sample output:


--- Content provided by FirstRanker.com ---



46


--- Content provided by FirstRanker.com ---


Result:
Thus the program to develop the scenario of two web Services- an airline service and travel agent is
searching for an airline using Web Services and Data base is written and executed successfully.
Outcome:

--- Content provided by FirstRanker.com ---

Thus the course outcome of implementing a program using AJAX, Spring, Struts and Web services (CO9) has
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System

--- Content provided by FirstRanker.com ---

3. Amazon Web Services




--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---

47




--- Content provided by FirstRanker.com ---


Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

--- Content provided by FirstRanker.com ---

2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

--- Content provided by FirstRanker.com ---

5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

7. Define ? HTML

--- Content provided by FirstRanker.com ---


8. Write the syntax of href?

9. Compare HTML and XHTML.

--- Content provided by FirstRanker.com ---

10. What is URL?



Expt.No.: 2 STYLE SHEETS

--- Content provided by FirstRanker.com ---


1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

--- Content provided by FirstRanker.com ---

3. What is CSS?

4. Define- Style sheet.

5. Discuss about embedded style sheets?

--- Content provided by FirstRanker.com ---


6. What are the style precedence rules when using multiple approaches?

7. List down the ways of including style information in a document.

--- Content provided by FirstRanker.com ---

8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

--- Content provided by FirstRanker.com ---

1. Describe about Java Scripts

2. Write about XML Elements.

48

--- Content provided by FirstRanker.com ---


3. What is XML?

4. Differentiate XML From HTML.

--- Content provided by FirstRanker.com ---

5. What is DHTML?

6. What are the form tags available in html?

7. What is the use of submit button?

--- Content provided by FirstRanker.com ---


8. What is URN?

9. What is URI?

--- Content provided by FirstRanker.com ---

10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS

--- Content provided by FirstRanker.com ---


1. What is POP3?

2. What are the steps to execute POP3?

--- Content provided by FirstRanker.com ---

3. What is FTP?

4. What is the difference between GET and POST method?

5. What is meant by http protocol?

--- Content provided by FirstRanker.com ---


6. How to make the connection with TCP?

7. Limitations of HTTP.

--- Content provided by FirstRanker.com ---

8. What is HTTP Session?

9.What is meant by loop back address?

10.What are the issues of next generation IP?

--- Content provided by FirstRanker.com ---





Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP

--- Content provided by FirstRanker.com ---


1. What is meant by Socket :
2. What are the two basic protocols used for transmitting the message?

3. What is meant by UDP?

--- Content provided by FirstRanker.com ---



49

4. What is the major difference between UDP and TCP/IP Protocol?

--- Content provided by FirstRanker.com ---


5. What is IP address?

6. What is OSI?
7. What is router?

--- Content provided by FirstRanker.com ---


8. What do you mean by hub?

9. What is URL?

--- Content provided by FirstRanker.com ---

10. Define packet switched networks.



Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

--- Content provided by FirstRanker.com ---


1. What is applet?

2. Explain applet life cycle?

--- Content provided by FirstRanker.com ---

3. How will you establish the connection between the servlet and an applet?

4. Can we pass parameters to an applet using
5. Compare Client and Server.

--- Content provided by FirstRanker.com ---

6. Compare swing and applet?

7. Differentiate between Servlet andApplet.


--- Content provided by FirstRanker.com ---



Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

1. What are servlets?

--- Content provided by FirstRanker.com ---


2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

--- Content provided by FirstRanker.com ---

4. When doPost() method of servlet to be called?

5. How to make database connection with servlet?

6. What is HttpSession?

--- Content provided by FirstRanker.com ---

7. What is CGI?

8. What are the SQL commands used for database in servlet?

50

--- Content provided by FirstRanker.com ---



9. What is tomcat server?

10. How sessions and cookies are used in servlet?

--- Content provided by FirstRanker.com ---






--- Content provided by FirstRanker.com ---


Expt.No.8: LOCKING SERVER ITSELF

1. How to read name of all filters in servlet?

--- Content provided by FirstRanker.com ---

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

--- Content provided by FirstRanker.com ---


5. Differentiate servlet config from servletcontext?

6. What is URL Encoding?

--- Content provided by FirstRanker.com ---

7. When doGet() method of servlet to be called?

8. When doPost() method of servlet to be called?


--- Content provided by FirstRanker.com ---

Expt.No.: 9 SESSION TRACKING IN SERVLET

1. How to read name of all fileters in servlet?

2. What is HTTPServletRequest class?

--- Content provided by FirstRanker.com ---


3. What is a servlet?

4. What are common tasks performed by servlet container?

--- Content provided by FirstRanker.com ---

5. Differentiate servlet config from servletcontext?

6. What are the phases of servlet life cycle?

7. What is URL Encoding?

--- Content provided by FirstRanker.com ---


8. When doGet() method of servlet to be called?

9. When doPost() method of servlet to be called?

--- Content provided by FirstRanker.com ---

10. What is the need for tracking session?

51


--- Content provided by FirstRanker.com ---



Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

1. What are cookies?

--- Content provided by FirstRanker.com ---


2. How to create a cookie using servlet?

3. How to read a cookie using servlet?

--- Content provided by FirstRanker.com ---

4. How do we get the database connection with servlet?

5. What are the uses of Servlet?

6. What is the use of servlet wrapper class?

--- Content provided by FirstRanker.com ---


7. What do you mean byJDBC?

8. Define ODBC.

--- Content provided by FirstRanker.com ---

9. List down the ways ODBC differ fromJDBC?

10. List down the types of drivers available in JDBC.


--- Content provided by FirstRanker.com ---

Expt.No.11: JSP STRUTS FRAMEWORK


1. What are the main components in struts application?

--- Content provided by FirstRanker.com ---

2. Why we use Struts?

3. What is strut?

4. What are the components of struts?

--- Content provided by FirstRanker.com ---


Expt.No.12 SPRING FRAMEWORK

1. What is Spring Framework?

--- Content provided by FirstRanker.com ---

2. What are some of the important features and advantages of Spring Framework?

3. Name some of the important Spring Modules?

4. What is spring?

--- Content provided by FirstRanker.com ---


5. What is spring IOC container?

6. What are spring beans?

--- Content provided by FirstRanker.com ---

52


7. What bean scopes does spring support?

--- Content provided by FirstRanker.com ---

8. What is Spring DAO?



Expt.No. 13: PROGRAM USING AJAX

--- Content provided by FirstRanker.com ---


1. What is Ajax?

2. What are Ajax applications?

--- Content provided by FirstRanker.com ---

3. What are the advantages of Ajax?

4. What are the disadvantages of AJAX?

5. What is update panel?

--- Content provided by FirstRanker.com ---


6. What are the two methods used for cross doman ajax calls?

7. What are the difference between ajax and javascript?

--- Content provided by FirstRanker.com ---


8. What are the extender controls?

9. What is ajax framework?

--- Content provided by FirstRanker.com ---

10. What are all the browsers support ajax?


Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

--- Content provided by FirstRanker.com ---

1. What is REST?

2. What is WSDL?

3. What is the SOAP encoding?

--- Content provided by FirstRanker.com ---


4. How can one access a class as a web service?

5. What are the steps performed by the client to access a web service?

--- Content provided by FirstRanker.com ---

6. Can you name some standards used in web services?

7. What are distributed technologies?

FirstRanker.com - FirstRanker's Choice

--- Content provided by FirstRanker.com ---