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.


1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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











FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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












FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System


FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:


FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.

FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site




































FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:




FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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.
Applications:1. Designing of Interactive Web Pages like Front page of Yahoo, Facebook and Tutorials point.
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.

















FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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


FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.







FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main


FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.










FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.


FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.








































FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you




FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.

























FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
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

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:

FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.












FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:

FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz















































FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)









FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.









FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.







































FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:


FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.







FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.

FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books




























FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot


























FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:





FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping




























FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:



FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:




46



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
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services













FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:




46



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
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services














47





Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

10. What is URL?



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

4. Define- Style sheet.

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.

8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

2. Write about XML Elements.
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:




46



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
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services














47





Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

10. What is URL?



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

4. Define- Style sheet.

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.

8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

2. Write about XML Elements.

48

3. What is XML?

4. Differentiate XML From HTML.

5. What is DHTML?

6. What are the form tags available in html?

7. What is the use of submit button?

8. What is URN?

9. What is URI?

10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS


1. What is POP3?

2. What are the steps to execute POP3?

3. What is FTP?

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?

7. Limitations of HTTP.

8. What is HTTP Session?

9.What is meant by loop back address?

10.What are the issues of next generation IP?




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?

3. What is meant by UDP?

FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:




46



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
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services














47





Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

10. What is URL?



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

4. Define- Style sheet.

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.

8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

2. Write about XML Elements.

48

3. What is XML?

4. Differentiate XML From HTML.

5. What is DHTML?

6. What are the form tags available in html?

7. What is the use of submit button?

8. What is URN?

9. What is URI?

10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS


1. What is POP3?

2. What are the steps to execute POP3?

3. What is FTP?

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?

7. Limitations of HTTP.

8. What is HTTP Session?

9.What is meant by loop back address?

10.What are the issues of next generation IP?




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?

3. What is meant by UDP?


49

4. What is the major difference between UDP and TCP/IP Protocol?

5. What is IP address?

6. What is OSI?
7. What is router?

8. What do you mean by hub?

9. What is URL?

10. Define packet switched networks.



Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

1. What is applet?

2. Explain applet life cycle?

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.

6. Compare swing and applet?

7. Differentiate between Servlet andApplet.




Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

1. What are servlets?

2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

4. When doPost() method of servlet to be called?

5. How to make database connection with servlet?

6. What is HttpSession?
7. What is CGI?

8. What are the SQL commands used for database in servlet?
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:




46



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
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services














47





Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

10. What is URL?



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

4. Define- Style sheet.

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.

8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

2. Write about XML Elements.

48

3. What is XML?

4. Differentiate XML From HTML.

5. What is DHTML?

6. What are the form tags available in html?

7. What is the use of submit button?

8. What is URN?

9. What is URI?

10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS


1. What is POP3?

2. What are the steps to execute POP3?

3. What is FTP?

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?

7. Limitations of HTTP.

8. What is HTTP Session?

9.What is meant by loop back address?

10.What are the issues of next generation IP?




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?

3. What is meant by UDP?


49

4. What is the major difference between UDP and TCP/IP Protocol?

5. What is IP address?

6. What is OSI?
7. What is router?

8. What do you mean by hub?

9. What is URL?

10. Define packet switched networks.



Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

1. What is applet?

2. Explain applet life cycle?

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.

6. Compare swing and applet?

7. Differentiate between Servlet andApplet.




Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

1. What are servlets?

2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

4. When doPost() method of servlet to be called?

5. How to make database connection with servlet?

6. What is HttpSession?
7. What is CGI?

8. What are the SQL commands used for database in servlet?

50


9. What is tomcat server?

10. How sessions and cookies are used in servlet?






Expt.No.8: LOCKING SERVER ITSELF

1. How to read name of all filters in servlet?

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

6. What is URL Encoding?

7. When doGet() method of servlet to be called?

8. When doPost() method of servlet to be called?


Expt.No.: 9 SESSION TRACKING IN SERVLET

1. How to read name of all fileters in servlet?

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

6. What are the phases of servlet life cycle?

7. What is URL Encoding?

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?
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:




46



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
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services














47





Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

10. What is URL?



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

4. Define- Style sheet.

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.

8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

2. Write about XML Elements.

48

3. What is XML?

4. Differentiate XML From HTML.

5. What is DHTML?

6. What are the form tags available in html?

7. What is the use of submit button?

8. What is URN?

9. What is URI?

10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS


1. What is POP3?

2. What are the steps to execute POP3?

3. What is FTP?

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?

7. Limitations of HTTP.

8. What is HTTP Session?

9.What is meant by loop back address?

10.What are the issues of next generation IP?




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?

3. What is meant by UDP?


49

4. What is the major difference between UDP and TCP/IP Protocol?

5. What is IP address?

6. What is OSI?
7. What is router?

8. What do you mean by hub?

9. What is URL?

10. Define packet switched networks.



Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

1. What is applet?

2. Explain applet life cycle?

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.

6. Compare swing and applet?

7. Differentiate between Servlet andApplet.




Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

1. What are servlets?

2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

4. When doPost() method of servlet to be called?

5. How to make database connection with servlet?

6. What is HttpSession?
7. What is CGI?

8. What are the SQL commands used for database in servlet?

50


9. What is tomcat server?

10. How sessions and cookies are used in servlet?






Expt.No.8: LOCKING SERVER ITSELF

1. How to read name of all filters in servlet?

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

6. What is URL Encoding?

7. When doGet() method of servlet to be called?

8. When doPost() method of servlet to be called?


Expt.No.: 9 SESSION TRACKING IN SERVLET

1. How to read name of all fileters in servlet?

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

6. What are the phases of servlet life cycle?

7. What is URL Encoding?

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?

51




Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

1. What are cookies?

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?

5. What are the uses of Servlet?

6. What is the use of servlet wrapper class?

7. What do you mean byJDBC?

8. Define ODBC.

9. List down the ways ODBC differ fromJDBC?

10. List down the types of drivers available in JDBC.


Expt.No.11: JSP STRUTS FRAMEWORK


1. What are the main components in struts application?

2. Why we use Struts?

3. What is strut?

4. What are the components of struts?

Expt.No.12 SPRING FRAMEWORK

1. What is Spring Framework?

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?

5. What is spring IOC container?

6. What are spring beans?
FirstRanker.com - FirstRanker's Choice

1


?




DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

CS6512 ? INTERNET PROGRAMMING LABORATORY
V SEMESTER - R 2013







Name : ______________________________________
Register No. : ______________________________________
Section : ______________________________________



LABORATORY MANUAL

2




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
? 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

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









VISION
VISION
MISSION
MISSION

2

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












3

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













4

CS6512 ? INTERNET PROGRAMMING LABORATORY
SYLLABUS



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

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
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?

COURSE OBJECTIVES

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.
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
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.
SOCKETS & SERVLETS
a) Write programs in Java using sockets to implement the following:
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
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.
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:
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.
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

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

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

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
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,
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

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.
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
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
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
SOCKETS & SERVLETS
b) Write programs in Java using sockets to implement the following:
i. HTTP request
ii. FTP
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:
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
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

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
ADVANCE CONCEPTS:
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
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


? 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
? 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









COURSE OUTCOMES

9

CS6512 ? INTERNET PROGRAMMING LABORATORY
CONTENTS
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
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
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
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
11. JSP Struts Framework 41
12. Spring Framework 43
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
Website

16.
Design Online Quiz like Moodle Web Site

17.
Inventory Management System using JSP with XAMPP

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

19.
Design and Implement a Library Management System



10

Expt. No.: 1 IMAGE MAPPING

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
(iii) Show all the related information when the hot spots are clicked
Software requirements:
Internet Explorer
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
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:



11







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.


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.
3. Designing of Personal Web site like GoDaddy, Wedding Site





































13

Expt.No.: 2 STYLE SHEETS

Aim:

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

Software requirements:
Internet Explorer
Hardware requirements:
Any Window OS

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
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:
Inline style sheet:





14

Embedded style sheet:





Cap.html:




External.html:

15


Caps.html:










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

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

Software requirements:
Internet Explorer
Hardware requirements:
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
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.
6. Server displays the student details to the client as a response.


















17

Sample output:






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



18


Expt.No. 4.(a) : HTTP REQUEST

Aim:
To write programs in Java using sockets to implement the Http Request
Software requirements:
Internet Explorer, Jdk 7
Hardware requirements:
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
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"
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)


Result:
Thus the java program using sockets to implement the http request messages has been executed
successfully.








19


Expt.No.4(b): FILE TRANSFER PROTOCOL (FTP)

Aim:
To write a program in Java using sockets to implement the FTP
Software requirements:
Internet Explorer, Jdk 7
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
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:
F:\IP>java Main
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :1
Enter File Name :server.java
File Already Exists. Want to OverWrite (Y/N) ? y
[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :3
F:\IP\client>java Main



20

[ MENU ]
1. Send File
2. Receive File
3. Exit
Enter Choice :2
Enter File Name :server.java
Receiving File ...
File Receive Successfully
[ MENU ]
1. Send File
2. Receive File
3. Exit
F:\IP>java server
FTP Server Started on Port Number 5217
Waiting for Connection ...
FTP Client Connected ...
Waiting for Connection ...
Waiting for Command ...
GET Command Received ...
Waiting for Command ...




Result:
Thus the java program using sockets to implement the FTP protocol messages has been executed
successfully.











21

Expt.No. 4 (c): SIMPLE MAIL TRANSFERPROTOCOL


Aim:
To write a java program to demonstrate a simple SMTP Client

Software requirements:
Jdk 7
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
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
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
13. Close the connection




Sample output:

F:\JAVA\BIN>javac smtp.java

F:\JAVA\BIN>javasmtp
Smtp Messages has been sent.


Result:
Thus the java program using sockets to implement the SMTP protocol messages has been executed
successfully.



22

Expt.No. 4(d): POST OFFICE PROTOCOL 3(POP3)

Aim:

To write a program in Java using sockets to implement the pop3

Software requirements:
Java
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
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
6. Read the form, to address and content

Sample output:
messages.length---298
---------------------------------
Email Number 1
Subject: Import your contacts and old email
From: Gmail Team
Text: javax.mail.internet.MimeMultipart@143c8b3
---------------------------------
Email Number 2
Subject: Send Staff Profile - Most Urgent
From: GEETHA P
Text: javax.mail.internet.MimeMultipart@12d7a10
---------------------------------
Email Number 3
Subject: Send AICTE Staff Profile
From: GEETHA P Text: javax.mail.internet.MimeMultipart@998b08

23

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.

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.









































24

Expt.No.5: IMPLEMENTATION OF CHAT APPLICATION - UDP


Aim:

To write a java program to create a simple chat application with datagram sockets
Software requirements:
Jdk 7
Hardware requirements:
Any window OS
Algorithm:

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
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
4. send the datagram packet to the server through serve port

Sample output:

F:\JAVA\BIN> javac client.java
F:\JAVA\BIN> java client
Client is sending data to the server
Hai
Hello how are you
F:\JAVA\BIN> javac server.java
F:\JAVA\BIN> java server
Server is waiting for data received from client
Hai
Hello how are you





25

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

Applications:
1. Chat application of 2 PCs, Yahoo Messenger, Face book Messenger.


























26

Expt.No.6(a): INVOKE SERVLETS FROM HTML

Aim:
To write a java program to invoke servlets from HTML forms
Software requirements:
Jdk 7, Internet Explorer
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
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()
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
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
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
compiling, again right click on index.jsp and select ?Run file?.
8. Now the browser(use firefox) will open and verify the output.

27

Sample output:





.Result: Thus the program for invokes the servlet from html is written and executed successfully.

28

Expt.No.6( b): INVOKE SERVLETS FROM APPLETS

Aim:
To write a java applet program that invokes servlet
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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
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
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.










Sample output:


29



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
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.
2. Design and implement web pages like Changing of Color, Creating separate HDFC login page.













30

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
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.
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.
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
3. Execute a SQL statement
4. Process the results
5. Close the connection to the database.
Sample output:


31




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.

Applications:
1. Design and Implement a Library Management System.

32

2. Design and Implement a Bank Management System.
3. Design and Implement an Online Quiz
















































33

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:
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.
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.
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.
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)










34

Sample output:




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
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
minutes and so on.










35

Expt.No.: 9 SESSION TRACKING IN SERVLET
Aim:
To write a servlet program using HTTP Servlet
Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)
Sample output:

Result:
Thus a servlet program using HTTP Servlet is created and executed successfully.

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.

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.








































37

Expt.No.: 10 SESSIONS & COOKIES IN SERVLET
Aim:
To create a web application using session and cookie using SERVLET

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
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.
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)

Sample output:



38





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
Servlet (CO6) has been attained.

Applications:

1. Displaying Results in Anna University Web site.
2. Displaying School Students Results.
3. Track the Bus or Cab through Sessions.








39

Expt.No.11: JSP STRUTS FRAMEWORK

Aim:
To develop strut application to validate the user name and password
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
Hardware requirements:
Any window OS
Algorithm:
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
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
7. Configuring and Running the Application
i. Setting the Welcome Page
ii. Attaching a Stylesheet
iii. Running the Application
Sample output:

Login Failure
E-mail: admin@yahoo.co.in.
Password: admin.


40


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.
Applications:
1. Designing a web page like Java Web Tutor.
2. Online Accounting
3. Displaying of E-Books





























41

Expt.No.12 SPRING FRAMEWORK

Aim:
To develop the spring application

Software requirements:
Jdk 7, Internet Explorer, Tomcat Server
Hardware requirements:
Any window OS
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.
5. Set command object and override onsubmit method.
6. Create view ,set command object.
7. Test your app.

Sample output:
Login page
User Name:
GEETHA

password:
*****

Login


New User?Register

Hello World! from main page






Result:
Thus the spring application was executed successfully.

42

Outcome:
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.
2. ERP
3. Spring Boot



























43

Expt.No. 13: PROGRAM USING AJAX

Aim:
To develop a simple program using AJAX
Software requirements:
Jdk 7, Internet Explorer,Tomcat Server
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.
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:






44

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.
Applications:
1. Provide a Web service through JSON web pages.
2. Provide a Web service like Online Shopping





























45

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
Software requirements:
Jdk 7, Internet Explorer
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
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


Sample output:




46



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
been attained.
Applications:
1. Airline Reservation System
2. Online Ticket Reservation System
3. Amazon Web Services














47





Expt. No.: 1 IMAGE MAPPING

1. Write the syntax and tags about tables.

2. What are the various types of lists?

3. Write the description starts with
.
4. Write about frames.

5. Write the scenario of links.

6. Can you list out the linking tags in HTML?

7. Define ? HTML

8. Write the syntax of href?

9. Compare HTML and XHTML.

10. What is URL?



Expt.No.: 2 STYLE SHEETS

1. Describe the Syntax about External / Internal Style Sheets.

2. Describe the Syntax about Inline Style Sheets.

3. What is CSS?

4. Define- Style sheet.

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.

8. Define cascading.


Expt. No.: 3 WEB FORM VALIDATION OF XML USING JS

1. Describe about Java Scripts

2. Write about XML Elements.

48

3. What is XML?

4. Differentiate XML From HTML.

5. What is DHTML?

6. What are the form tags available in html?

7. What is the use of submit button?

8. What is URN?

9. What is URI?

10. Differentiate client side scripting from server side scripting.


Expt.No. 4: PROTOCOLS


1. What is POP3?

2. What are the steps to execute POP3?

3. What is FTP?

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?

7. Limitations of HTTP.

8. What is HTTP Session?

9.What is meant by loop back address?

10.What are the issues of next generation IP?




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?

3. What is meant by UDP?


49

4. What is the major difference between UDP and TCP/IP Protocol?

5. What is IP address?

6. What is OSI?
7. What is router?

8. What do you mean by hub?

9. What is URL?

10. Define packet switched networks.



Expt.No.6: INVOKE SERVLETS FROM HTML , APPLET

1. What is applet?

2. Explain applet life cycle?

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.

6. Compare swing and applet?

7. Differentiate between Servlet andApplet.




Expt.No.:7 ONLINE DATA BASE APPLICATION USING SERVLET

1. What are servlets?

2. Explain servlet life cycle methods?

3. When doGet() method of servlet to be called?

4. When doPost() method of servlet to be called?

5. How to make database connection with servlet?

6. What is HttpSession?
7. What is CGI?

8. What are the SQL commands used for database in servlet?

50


9. What is tomcat server?

10. How sessions and cookies are used in servlet?






Expt.No.8: LOCKING SERVER ITSELF

1. How to read name of all filters in servlet?

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

6. What is URL Encoding?

7. When doGet() method of servlet to be called?

8. When doPost() method of servlet to be called?


Expt.No.: 9 SESSION TRACKING IN SERVLET

1. How to read name of all fileters in servlet?

2. What is HTTPServletRequest class?

3. What is a servlet?

4. What are common tasks performed by servlet container?

5. Differentiate servlet config from servletcontext?

6. What are the phases of servlet life cycle?

7. What is URL Encoding?

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?

51




Expt.No.: 10 SESSIONS & COOKIES IN SERVLET

1. What are cookies?

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?

5. What are the uses of Servlet?

6. What is the use of servlet wrapper class?

7. What do you mean byJDBC?

8. Define ODBC.

9. List down the ways ODBC differ fromJDBC?

10. List down the types of drivers available in JDBC.


Expt.No.11: JSP STRUTS FRAMEWORK


1. What are the main components in struts application?

2. Why we use Struts?

3. What is strut?

4. What are the components of struts?

Expt.No.12 SPRING FRAMEWORK

1. What is Spring Framework?

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?

5. What is spring IOC container?

6. What are spring beans?

52


7. What bean scopes does spring support?

8. What is Spring DAO?



Expt.No. 13: PROGRAM USING AJAX

1. What is Ajax?

2. What are Ajax applications?

3. What are the advantages of Ajax?

4. What are the disadvantages of AJAX?

5. What is update panel?

6. What are the two methods used for cross doman ajax calls?

7. What are the difference between ajax and javascript?


8. What are the extender controls?

9. What is ajax framework?

10. What are all the browsers support ajax?


Expt.No.14: AIR LINE RESERVATION SYSTEM USING WS

1. What is REST?

2. What is WSDL?

3. What is the SOAP encoding?

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?

6. Can you name some standards used in web services?

7. What are distributed technologies?

FirstRanker.com - FirstRanker's Choice

This post was last modified on 13 December 2019