EX - NO:1 Creating A Web Page Using Image Map Date:: I) Ii) Iii)
EX - NO:1 Creating A Web Page Using Image Map Date:: I) Ii) Iii)
DATE :
AIM:
To create a webpage with the following using HTML:
i) To embed an image map in a webpage.
ii) To fix the hotspots.
iii) Show all the related information when the hot spots arec licked.
ALGORITHM:
Step 1: Open notepad and type the HTML coding for homepage home. Html which hasan
image map using<MAP>tag and create some hotspots
Step 2: Hotspots are created by including a link at required coordinate position using
<a> tag which directs to its corresponding web pages
Step 3: Write the coding for all the link web pages
PROGRAM:
home.html
<html>
<head>
<title>Home-StatesofIndia!!!</title>
</head>
<bodybgcolor="gold">
<h1><u><center>RepublicofIndia</center></u></h1>
<p>
IndiaistheSeventhLargestcountryintheworldbygeographicalare
a,thesecondmostPopulouscountrywithover1.3billionpeople,Ind
iaisavastSouthAsiancountrywithdiverseterrain–
fromHimalayanpeakstoIndianOceancoastline–
andhistoryreachingback5millennia..Indiaisafederalconstitutionalrepublicwithaparliamentaryde
mocracyconsistingof28states and7Union Territories.</p>
<center>
<imgalign="center"width="275"height="290"alt="India"src="IndiaMap.jpg"usemap="#indi
a"ismap="ismap">
<mapname="india">
<areashape="circle"coords="100,200,10"href="ANDHRAPRADESH.html"alt="Learnabou
t andra">
<areashape="circle"coords="70,275,10"href="KERALA.html"alt="Learnaboutkerala">
<areashape="circle"coords="70,210,20"href="KARNATAKA.html"alt="Learnaboutkarnat
a ka">
<areashape="circle"coords="100,250,20"href="TAMILNADU.html"alt="Learnabouttamil
n adu">
</map></center>
<h2>Features</h2>
<ul>
<li><b>Population</b>-133.92crores(2019).
<li><b>Capital</b>-NewDelhi
<li><b>LargestCity</b>-Mumbai
<li><b>Currency</b>-IndianRupee
<li><b>TimeFormat</b>-IST(UTC+5:30)
<li><b>NationalSport</b>-Hockey
<li><b>CurrentPM</b>-NarendraModi
<li><b>CurrentPresident</b>-PranabMukherjee
</li>
</ul>
<h2><b>Toviewdetailsofsouthernstatespleaseclickonthespecifiedareainthemap!</b>
</h2>
</body>
</html>
Tamilnadu.html
<html>
<head><title>TamilNadu-India</title></head>
<bodybgcolor="palegreen">
<h1><center>TamilNadu</center></h1>
<h3>isoneofthe29statesofIndia.ItscapitalandlargestcityisChennai.TamilNadulies
inthesouthernmostpartoftheIndianPeninsulaand
ItisborderedbytheStatesofPuducherry,Kerala,Karnataka,AndhraPradesh
</h3><h3>
<ul>
<li>Districts<i>-37</i>
<li>CapitalCity<i>-Chennai</i>
<li>LargestCity<i>-Chennai</i>
<li>Governor<i>-BanwarilalPurohit</i>
<li>ChiefMinister<i>-Palanisamy</i>
<li>Population<i>-80,351,195</i>
<li>Touristspots<i>-
Mamallapuran,Ooty,Kodaikanal,Marina,MuduraiMeenakshiAmmanTem
ple,Thanjavuretc.,</i>
</ul>
<ahref="Home.html">back</a>
</body>
</html>
andhrapradesh.html
<html>
<head><title>AndhraPradesh-India</title></head>
<bodybgcolor="tan">
<h1><center>AndhraPradesh</center></h1>
<h3>A.P.,isastatesituatedonthesoutheasterncoastofIndia.ItisIndia'sfourthl
argeststatebyareaandfifthlargestbypopulation.</h3>
<h3>
<ul>
<li>Districts<i>-13</i>
<li>CapitalCity<i>-Hyderabad</i>
<li>LargestCity<i>-Hyderabad</i>
<li>Governor<i>-BISWABHUSANHARICHARAN</i>
<li>ChiefMinister<i>-Y.S.JAGANMOHANREDDY</i>
<li>Population<i>-91,103,010</i>
<li>Touristspots<i>-
TirumalaTirupati,Guntur,GolcondaFort,Chandragiri,Arakuvalley,F
alaknumaPalaceetc.,</i>
</ul>
<ahref="Home.html">back</a>
</body> </html>
Karnataka.html
<html>
<head><title>Karnataka-India</title></head>
<bodybgcolor="wheat">
<h1><center>Karnataka</center></h1>
<h3> <ul>
<li>Districts<i>-30</i>
<li>CapitalCity<i>-Bangalore</i>
<li>LargestCity<i>-Bangalore</i>
<li>Governor<i>-VajubhaiVala</i>
<li>ChiefMinister<i>-B.S.YEDIYURAPPA</i>
<li>Population<i>- 68,308,304</i>
<li>Touristspots<i>-GolGumbaz,MysorePalace,KeshavaTempleetc.,</i>
</ul>
</h3>
<ahref="Home.html">back</a>
</body>
</html>
Kerala.html
<html>
<head><title>Kerala-India</title></head>
<bodybgcolor="indianred">
<h1><center>Kerala</center></h1>
<h3>
<ul>
<li>Districts<i>-14</i>
<li>CapitalCity<i>-Thiruvanandapuram</i>
<li>LargestCity<i>-Thiruvanandapuram</i>
<li>Governor<i>-ARIFMOHAMMADKHAN</i>
<li>ChiefMinister<i>-PINARAYIVIJAYAN</i>
<li>Population<i>-34,545,868</i>
<li>Touristspots<i>-
EdakkalCaves,Palayur,KovalamBeach,Munnar,Kochi,Alapuzhaetc.,</i>
</ul>
<ahref="Home.html">back</a>
</h3>
</body>
</html>
OUTPUT:
Result :
Thus a web page with given specifications was created and its output was verified successfully.
EX.NO: 2 CREATING A WEBPAGE WITH CASCADING STYLE SHEET
DATE :
AIM:
To create a webpage with the following using html to embedded the style sheet
ALGORITHM:
Step1: Create html file with the style tag, inside head tag.
Step2: Set the style such as font-family, font-size, color, left etc, for the
Step4: Specify the heading and information required inside the body tag.
PROGRAM:
<! DOCTYPE html PUBLIC"-////W3C//DTD XHTML 1.0
TRANSTION//EN"http://www.w3.org/TR/html1/DTD/html1 1.dtd>
<html xmlns="http://www.w3org/1999/xhtml">
<head>
<title>Embedded style sheet</title>
<style type="text/css">h1
{
font-
family:arial;
color:green;
}
h2
{
font-family:arial;
color:red;
left:20px
}
h3
{
font-family:arial;
color:blue;
}
p
{
font-sise:14pt;
font-family:verdana
}
</style>
</head>
<body>
<h1>
<center>This is created using embedded style sheet
</center>
</h1>
<h2>This line is allingned left and red colored;
</h2>
<p>
The embedded style sheet is the most commonly used style
sheetThis paragragh is return in verdana font with font size of
14.
</p>
<h3>
This is a blue <a href="colorname.html">colored</a> line
</h3>
</body>
</html>
OUTPUT:
RESULT:
Thus creation of an webpage using cascading style sheet has been developedsuccessfully.
EX.NO :3 CLIENT SIDE SCRIPTS for validating web form control using DHTML
DATE:
AIM:
PROGRAM:
//Webforms.html
<html>
<head>
<script
type='text/javascript'>
function formValidator()
{
var
firstname=document.getElementById('firstname');
var lastname=document.getElementById('lastname');
var addr=document.getElementById('addr');
var zip=document.getElementById('zip');
var
11
Countries=document.getElementById('Countries');
var username=document.getElementById('username');
var email=document.getElementById('email');
var dd=document.getElementById('dd');
var
mm=document.getElementById('mm');
var yyyy=document.getElementById('yyyy');
var
comment=document.getElementById('comment');var
password=document.getElementById('password');
if(isAlphabet(firstname,"Please enter only letters for your First name"))
{
if(isAlphabet(lastname,"Please enter only letters for your Last name"))
{
if(isNumeric(dd,"Please enter a date"))
{
if(madeSelection(mm,"Please Choose"))
{
if(isNumeric(yyyy,"Please enter a year"))
{
if(isAlphanumeric(addr,"Enter Numbers and letters only for address"))
{
if(isNumeric(zip,"please enter a valid zip code"))
{
if(madeSelection(Countries,"Please Choose"))
{
if(lengthRestriction(username,6,8))
{
if(isAlphanumeric(password,"Enter Numbers and letters only for password"))
{
if(emailValidator(email,"Please enter a valid email address"))
{
if(notEmpty(comment,"Please fill the comment"))
{
12
document.write("<b><i>Thank's for submitting your
details</i></b>");alert("Successful Entry!!");
return true;
}}}}}}}}}}}}
return false;
}
function notEmpty(elem,helperMsg)
{
if(elem.value.length==0)
{
alert(helperMsg)
;elem.focus();
return false;
}
return true;
}
function isNumeric(elem,helperMsg)
{
var numericExpression=/^[0-9]+$/;
if(elem.value.match(numericExpression))
{
return true;
}
else
{
alert(helperMsg)
;elem.focus();
return false;
}
}
function isAlphabet(elem,helperMsg)
{
var alphaExp=/^[a-zA-Z]+$/;
if(elem.value.match(alphaExp)
13
)
return true;
}
else
{
alert(helperMsg);
elem.focus()
;return false;
}
}
function isAlphanumeric(elem,helperMsg)
{
var alphaExp=/^[0-9, a-z a-z, 0-9, A-Z A-Z, - 0-9 .
]+$/;if(elem.value.match(alphaExp))
{
return true;
}
else
{
alert(helperMsg)
;elem.focus();
return false;
}
}
function lengthRestriction(elem,min,max)
{
var unput=elem.value;
if(unput.length>=min&&unput.length<=max)
{
return true;
}
else
14
{
alert("Please enter between "+min+" and "+max+"
charactters");elem.focus();
return false;
}
}
function madeSelection(elem,helperMsg)
{
if(elem.value=="Please Choose")
{
alert(helperMsg)
;elem.focus();
return false;
}
else
{
return true;
}
}
function emailValidator(elem,helperMsg)
var emailExp=/^[0-9 a-z . a-z 0-9]+\@[a-z]+\.[a-
z]{2,4}$/;if(elem.value.match(emailExp))
{
return true;
}
else
{
alert(helperMsg)
;elem.focus();
return false;
}
}
</script>
15
<h1><center><b><font color="#347235">Please
Enter YourDetails</font></b></center></h1>
</head>
<body bgcolor="LIGHTGREEN">
<hr>
<form onsubmit='return formValidator()' height="50%">
<table height="50%" border="3pt" align="center">
<tr><td><b><font color="#347235">First
Name:</font></b></td><td><inputtype='text'
id='firstname'/></td></tr><br />
<tr><td><b><font color="#347235">Last
Name:</font></b></td><td><inputtype='text' id='lastname'/></td></tr><br
/>
<tr><td><b><font color="347235">Date of
Birth(dd/mm/yyyy):</font></b></td><td><input
type='text' id='dd' />
<select id='mm'>
<option>Please Choose</option>
<option value="1">Jan</option>
<option value="2">Feb</option>
<option value="3">Mar</option>
<option value="4">Apr</option>
<option value="5">May</option>
<option value="6">Jun</option>
<option value="7">Jul</option>
<option value="8">Aug</option>
<option value="9">Sep</option>
<option value="10">Oct</option>
<option value="11">Nov</option>
<option value="12">Dec</option>
</select>
<input type='text' id='yyyy' /></td></tr><br />
16
<tr><td><b><font
color="#347235">Address:</font></b></td><td><inputtype='text'
id='addr'/></td></tr><br />
<tr><td><b><font color="#347235">Zip
code:</font></b></td><td><inputtype='text' id='zip'/></td></tr><br />
<tr><td><b><font
color="#347235">Countries:</font></b></td><td><selectid='Countries'>
<option>Please Choose</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Afghanistan">Afghanistan</option>
<option value="America">America</option>
<option value="India">India</option>
<option value="Tanzania">Tanzania</option>
<option value="Zimbabwe">Zimbabwe</option>
<option value="Switzerland">Switzerland</option>
</select></td></tr><br />
<tr><td><b><font color="#347235">Username(6-8
characters):</font></b></td><td><input type='text' id='username'
/></td></tr><br />
<tr><td><b><font
color="#347235">Password:</font></b></td><td><inputtype='password'
id='password' /></td></tr><br />
<tr><td><b><font
color="#347235">Email:</font></b></td><td><inputtype='text'
id='email' /></td></tr><br />
<tr><td><b><font
color="#347235">Comment:</font></b></td><td><textarea
id='comment'cols="20"rows="5"
name="Address"></textarea></td></tr><br />
<tr><td><input type='submit' value='Check Form' /></td></tr>
</table>
</form>
</body></html
17
OUTPUT:
18
RESULT :
Thus developing client side scripts for validating web from controlsusingDHTML has been verified
Successfully.
19
EX.NO :4 INSTALLING & CONFIGURING TOMCAT – WEBSERVER
DATE:
AIM:
PROCEDURE:
Step 1: Visit Apache Tomcat home page with a Web browser, and click the "Download" linkunder
the "Tomcat 7.0.70 Released" section. You will see the"Tomcat 7 Downloads"page.
Step 2: Click "32-bit Windows zip" link under "Binary Distributions" section. Youwill see the
download file save dialog box.(this supports jdk1.6 kit)
Step 3: Use the "Save file" option to save the download file
"apache-tomcat-7.0.70-windows-x86.zip" to a temporary folder.
Step 4: Unzip "apache-tomcat-7.0.70-windows-x86.zip" to file installation folder“C:\
apache-tomcat-7.0.70”.
Step 5: Try to start Tomcat server by running the "startup" command in acommand
linewindow:
C:\ >cd apache-tomcat-7.0.70\bin
C:\ >cd apache-tomcat-7.0.70\bin>startup
20
Server.xml Web.xml
Tomcat- user.xml
Context.xml
Open web.xml in notepad & modify default-listings-false to true
Open server.xml & change port number 8080 to any other (8081) if any
application access thesame port Open context.xml change reloadable attribute to
true on figurationprocedure varies according to the version.
OUTPUT:
RESULT:
Thus the Tomcat server is installed and configured successfully.
21
EX.NO : 5 A INVOKING SERVLET FROM HTML FORMS
DATE:
AIM:
To write a html program for invoking servlet using html.
ALGORITHM:
Step1: In html program, define the html, head and title tag.
Step2: Then the title is Student Information Form and close the title and head tag.
Step3: Define the body tag inside the body tag create form
andtable simultaneously.
Step4: The table consists of following information Roll no, Student
name,Address, Phone no and total marks.
Step5: In the servlet program, import the summary package and create
aownservlet class extends with generic servlet.
Step6: In the service method defined to request and response.
Step7: Create the object and for print writer and get
writer()value.Step8: The enumeration object get the servlet
request parameter.
Step9: Create objects for string method and it is displayed another
object valuereceived get parameter of name received and
displayed thevalue received value.
PROGRAM:
//index.jsp
<html>
<head>
<title>Processing get requests with data</title>
</head>
<body>
<form action = "Servlet3" method = "get">
<b><p><label>Enter Your name Please!!
<br />
//Servlet3.java
import
java.io.IOException;import
java.io.PrintWriter;
import javax.servlet.ServletException;
import
javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse;
23
// body section of
documentout.println(
"<body>" );
out.println( "<h1>Hello " + firstName + ",<br />"
);out.println( "Welcome to Servlets!</h1>" );
out.println( "</body>" );
// end XHTML document
out.println( "</html>" );
out.close(); // close stream to complete the page
}
public String
getServletInfo() {
return "Short
description";
}
}
OUTPUT:
24
RESULT:
Thus the invocation of servlet from HTML from has been developed successfully.
25
EX.NO : 5 B SESSION TRACKING
DATE:
AIM:
To write a html program for invoking servlet using html.
ALGORITHM:
STEP 1: Remove a specific attribute You can delete the value associated with a specific keyby
calling the public void remove Attribute(String name) function.
STEP 2:Delete your whole session. To delete an entire session, use the public void invalidate()
function.
STEP 3:Setting Session Timeout You may set the timeout for a session separately by calling
the public void set MaxInactiveInterval(int interval) function.
STEP 4:Log the user out On servers that support servlets 2.4, you may use the logout method
to log the client out of the Web server and invalidate all of the users’ sessions.
STEP 4:web.xml Configuration If you’re using Tomcat, you may set the session timeout in the
web.xml file, in addition to the ways listed above.
PROGRAM:
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
26
// Get session creation time.
Date createTime
= new Date(session.getCreationTime());
String docType
= "<!doctype html public \"-//w3c//dtd html 4.0 "
+ "transitional//en\">\n";
27
out.println(
docType + "<html>\n"
+ "<head><title>" + title + "</title></head>\n"
+
"<tr>\n"
+ " <td>id</td>\n"
+ " <td>" + session.getId() + "</td>"
+ "</tr>\n"
+
"<tr>\n"
+ " <td>Creation Time</td>\n"
+ " <td>" + createTime + " </td>"
+ "</tr>\n"
+
"<tr>\n"
+ " <td>Time of Last Access</td>\n"
28
+ " <td>" + lastAccessTime + "</td>"
+ "</tr>\n"
+
"<tr>\n"
+ " <td>User ID</td>\n"
+ " <td>" + userID + "</td>"
+ "</tr>\n"
+
"<tr>\n"
+ " <td>Number of visits</td>\n"
+ " <td>" + visitCount + "</td>"
+ "</tr>\n"
+ "</table>\n"
+ "</body>"
+ "</html>");
}
}
File: web.xml
• XML
<web-app>
<servlet>
<servlet-name>GfgSession</servlet-name>
<servlet-class>GfgSession</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>GfgSession</servlet-name>
29
<url-pattern>/GfgSession</url-pattern>
</servlet-mapping>
Compile the servlet SessionTrack described above and add it to the web.xml file. When you
run http://localhost:8080/SessionTrackingGfg/GfgSession
Output:
If we try to run the same servlet again, we will get the following result.
RESULT:
Thus the invocation of servlet in session tracking been developed successfully.
30
EX.NO : 6 A ONLINE EXAMINATION
DATE:
AIM:
To write a java servlet program to conduct online examination and to displaystudentmark list
available in a database.
ALGORITHM:
Step1: Create a html file with form tag.
Step4: The 5 question are defined into true or false model and close the all tags.
Step5: Import the necessary packages and declare class, class name in exam.
Step7: Use the deposit () for check the connection in JDBC:ODBC driver.
compilation.
PROGRAM:
//index.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to Online Examination!!!!</title>
31
</head>
<body>
Welcome to Online Examination!!!!
<form action="exam" method="get">
<label><p> Enter Your name Please!!<br/>
<inputtype="text"name="name"/>
<br/>
<input type="submit" name="SUBMIT"/>
</p></label>
</form>
</body>
</html>
//exam.java
import java.io.IOException;import
java.io.PrintWriter;
import javax.servlet.ServletException;
import
javax.servlet.annotation.WebServlet;import
javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse;public
class exam extends HttpServlet {
protected void doGet(HttpServletRequest
request,HttpServletResponseresponse)
throws ServletException, IOException
{response.setContentType("text/html");
PrintWriter out=response.getWriter();
String
name=request.getParameter("name");
out.println("<html>");
out.println("<head>");
out.println("<title>Online
Examination</title>");out.println("</head>");
out.println("<body bgcolor=PINK>");
32
out.println("<h2 align=center>Online
Examination</h2><hr>"); out.println("<h3 align=center>
Welcome
Mr."+name+"</h3><hr>");out.println("<h4><u>Terms and
Conditions:</u></h4>"); out.println("<ul type=disc>");
out.println("<li>The Paper consists a set of five
questions.</li>");out.println("<li>Every question consists of
two options.</li>"); out.println("<li>All must be
answered</li></ul><hr>"); out.println("<center><h5><u>Your
Questions</u></h5></center>");out.println("<hr>");
out.println("<form method=get action=exam2>");
out.println("<p>1.Operating System is a..................</p>");
out.println("<input type=radio
name=q1
value=0>Hardware");out.println("<br>
");out.println("<input type=radio
name=q1
value=1>Software");out.println("<hr>"
);
out.println("<p>2.Developer of C Language is ................ </p>");
out.println("<br>");
out.println("<input type=radio name=q2
value=0>DennisRichee");out.println("<br>");
out.println("<input type=radio name=q2
value=1>JamesThompson");out.println("<hr>");
out.println("<p>3.Which of the following is a
multitasking,multiuser,multiprocessing);
out.println("OS. ....... </p>");
out.println("<br>");
out.println("<input type=radio name=q3
value=0>MSDOS");out.println("<br>");
out.println("<input type=radio name=q3
value=1>WindowsNT");out.println("<hr>");
33
out.println("<p>4.Father of Computers is................. </p>");
out.println("<br>");
out.println("<input type=radio name=q4 value=1>Charles
babbage");out.println("<br>");
out.println("<input type=radio name=q4 value=0>Charles
Dickson");out.println("<hr>");
out.println("<p>5.What is the current generation of computers
?</p>");out.println("<br>");
out.println("<input type=radio name=q5
value=0>Fifth");out.println("<br>");
out.println("<input type=radio name=q5
value=1>Sixth");out.println("<hr>");
out.println("<input type=submit
value=Done>");out.println("</form>");
out.println("</body>");
out.println("</html>");
}
public String getServletInfo()
{ return "A Servlet of the
user";
}
}
//exam2.java
import
java.io.IOException;import
java.io.PrintWriter;
import javax.servlet.ServletException;
import
javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import
34
javax.servlet.http.HttpServletResponse;public
class exam2 extends HttpServlet {
protected void doGet(HttpServletRequest request,
HttpServletResponse
response)
throws ServletException,
IOException {int count=0,j;
response.setContentType("text/html
");PrintWriter
out=response.getWriter(); String
q1=request.getParameter("q1");
String
q2=request.getParameter("q2");
String
q3=request.getParameter("q3");
String
q4=request.getParameter("q4");
String
q5=request.getParameter("q5");
if(q1.equals("1"))
{
count=count+1;
}
if(q2.equals("1"))
{
count=count+1;
}
if(q3.equals("1"))
{
count=count+1;
}
if(q4.equals("1"))
{
count=count+1;
}
35
if(q5.equals("1"))
{
count=count+1;
}
out.println("<html>");
out.println("<head><title>Examination
Results</title></head>");out.println("<body>");
out.println("<h2 align=center<Online Examination</h2><hr>");
out.println("<h3>Number of Questions answered
correctly:</h3>"+count);if(count>=3)
{
out.println("<hr><h3>Congrats!!! You Have
Passed!!!</h3><hr>");
out.println("<h4><b>Try Other Tests!!</b></h4>");
}
else
{
out.println("<hr><h3>Sorry!!! You Have
Failed!!!</h3><hr>");out.println("<h4><b>Try
Again:</b></h4>");
}
out.println("</body>");
out.println("</html>");
}
public String getServletInfo() {
return "A Servlet of the
User";
}
}
36
OUTPUT:
37
RESULT:
Thus the development of program in java to create three tireapplicationusing servlet has been verified
successfully.
38
EX.NO : 6 B DISPLAYING STUDENT MARKLIST USING JSP
DATE:
AIM:
To create a three tier application for displaying student mark list using JSP and database.
ALGORITHM:
1. Design the HTML page (stud.html) with the following
a) Create a form to get the input (Register Number) from the user.
b) Set the URL of the server (marklist.jsp) as the value of the action attribute.
c) Use submit button to invoke the server and send the form data to the server.
2. Create the JSP file with the following
a) Read the parameter value (Register Number) from the form by using the method
getParameter().
b) Server retrieves the details from the database table with respect to the form input.
c) Server displays the mark list to the client as the response.
marklist.jsp:
stud.HTML:
<html>
<head>
<title>Three Tier Application</title>
<style type="text/css">
body{color:blue;font-family:courier;text-align:center}
</style>
</head>
<body>
<h2>EXAMINATION RESULT</h2><hr/>
<form name="f1" method"GET" action="marklist.jsp">
Enter Your Reg.No:
40
<input type="text" name="regno"/><br/><br/>
<input type="submit" value="SUBMIT"/>
</form>
</body>
<html>
Database
41
OUTPUT SCREENSHOTS
RESULT:
Thus the creation of a three tier application for displaying studentmark list using JSP and database has
been verifiedsuccessfully.
42
EX.NO : 7 XML SCHEMA FOR STUDENT DETAILS
DATE:
AIM:
To write a program for implementing student information using XML & XSL.
ALGORITHM:
Step1:The XML document reference to the XSL document.
Step2: The create the student information in the student tag and insert the
sameinformation about the student.
Step3:Close all opened tags.
Step4:In XSL document create a html file include the student information in table format.
Step5:Close the necessary tags.
PROGRAM:
//student.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="student.css"?>
<!DOCTYPE student SYSTEM "student.dtd">
<students>
<student>
<sno>801041</sno>
<sname>S.Soundarapandian</sname>
<dob>05/081991</dob>
<address>Neyveli</address>
<m1>80</m1>
<m2>90</m2>
<m3>95</m3>
</student>
<student>
<sno>801049</sno>
<sname>R.Vadivelan</sname>
<dob>22/07/1990</dob>
43
<address>Pondicherry</address>
<m1>90</m1>
<m2>95</m2>
<m3>80</m3>
</student>
<student>
<sno>801037</sno>
<sname>R.Satheesh</sname>
<dob>21/01/1991</dob>
<address>Kanyakumari</address>
<m1>80</m1>
<m2>90</m2>
<m3>95</m3>
</student>
</students>
//student.css
Student { background.color:#aabbcc;width:100%;} Sno {
display:block; color:GREEN; font.size:25pt; } Sname {
display:block; color:BLACK; font.size:20pt; }Dob {
display:block; color:BLUE; font.size:15pt; } Address {
display:block; color:BLUE; font.size:15pt; }m1 {
display:block; color:BLUE; font.size:15pt; }
m2 { display:block; color:BLUE; font.size:15pt; }m3
{display:block; color:BLUE; font.size:15pt;}
//student.dtd`
<?xml version="1.0"?>
<!ELEMENT students (student+)>
<!ELEMENT student (sno,sname,dob,address,m1,m2,m3)>
<!ELEMENT sno (#PCDATA)>
<!ELEMENT sname (#PCDATA)>
<!ELEMENT dob (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT m1 (#PCDATA)>
<!ELEMENT m2 (#PCDATA)>
<!ELEMENT m3 (#PCDATA)>
44
OUTPUT:
RESULT:
Thus the creation of XSL document using Xml has been verified successfully.
45
46