Exam Practices
Exam Practices
Exam Practices
HTML
HTML stands for Hyper Text Markup Language. HTML is the standard
markup language for creating Web pages. HTML describes the structure
of a Web page. HTML consists of a series of elements. HTML elements tell
the browser how to display the content.
<body>
<div id="main">
<h1>Customers</h1>
<table>
<tr>
<th>Name</th>
<th>City</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Berlin</td>
<td>Germany</td>
</tr>
<tr>
<td>Berglunds snabbköp</td>
<td>Luleå</td>
<td>Sweden</td>
</tr>
</table>
<footer id="foot01"></footer>
</div>
<script src="script.js"></script>
</body>
</html>
body {
font-family: "Trebuchet MS", Verdana, sans-serif;
font-size: 16px;
background-color: dimgrey;
color: #696969;
padding: 3px;
}
#main {
padding: 5px;
padding-left: 15px;
padding-right: 15px;
background-color: #ffffff;
border-radius: 0 0 5px 5px;
}
h1 {
font-family: Georgia, serif;
border-bottom: 3px solid #cc9900;
color: #996600;
font-size: 30px;
}
JAVASCRIPT EXAMPLES
<html>
<head>
<title>Event!!!</title>
<script type="text/javascript">
function trigger()
document.getElementById("hover").addEventListener("mouseover", popup);
function popup()
alert("Welcome to my WebPage!!!");
</script>
<style>
font-size:50px;
position: fixed;
left: 550px;
top: 300px;
</style>
</head>
<body onload="trigger();">
<p id="hover">Welcome!!!</p>
</body>
</html>
XML PROGRAMS
XSLT Elements
o #1) <xsl:stylesheet> OR<xsl:transform>
o #2) <xsl:template>
o #3) <xsl:apply-templates>
o #4) <xsl:call-template>
o #5) <xsl:value-of>
o #6) <xsl:for-each>: Repetition
o #7) <xsl:if>: Conditional Processing
o #8) <xsl:choose>: Alternatives condition processing
o #9) <xsl:copy>
o #10) <xsl:copy-of>
o #11) <xsl:comment>
o #12) <xsl:text>
o #13) <xsl:element>
o #14) <xsl:attribute>
o #15) <xsl:sort>
o #16) <xsl:variable>
o #17) <xsl:Key>
o #18) <xsl:message>
o #19) <xsl:param>&<xsl:with-param>
o #20) <xsl:import>
o #21) <xsl:include>
o #22)<xsl:output>
o #23) <xsl:strip-space>
o #24) <xsl:preserve-space>
Books.xml
Servlet program
1. <web-app>
2.
3. <servlet>
4. <servlet-name>sonoojaiswal</servlet-name>
5. <servlet-class>DemoServlet</servlet-class>
6. </servlet>
7.
8. <servlet-mapping>
9. <servlet-name>sonoojaiswal</servlet-name>
10. <url-pattern>/welcome</url-pattern>
11. </servlet-mapping>
12.
13. </web-app>
<html>
<head>
</head>
<body>
<center>
</center>
<%
%>
</body>
</html>
A JSP website that uses the programme to collect the amount of hits. We are
counting the number of hits to a JSP page using the implicit object of the
application in this case.
COUNTER.JSP
<html>
<head>
</head>
<body>
<%
counter = 1;
}else{
counter = counter+ 1;
application.setAttribute("numberOfVisits", counter);
%>
</body>
</html>