OUTPUT AI-flat
OUTPUT AI-flat
Implement a web page index.htm for any client website (e.g., a restaurant website project)
using following: a. HTML syntax: heading tags, basic tags and attributes, frames, tables,
images, lists, links for text and images, forms etc. b. Use of Internal CSS, Inline CSS, External
CSS.
Login.html:-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login | TastyBite</title>
<style> body {
background: #f2f2f2;
</style>
</head>
<body>
<div class="container">
<form>
<div class="mb-3">
<div class="mb-3">
<label class="form-label">Password</label>
</form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Register.html:- <!DOCTYPE
html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Register | TastyBite</title>
<style> body {
background: #f2f2f2;
</style>
</head>
<body>
<div class="container">
<form>
<div class="mb-3">
<label class="form-label">Full Name</label>
<div class="mb-3">
<div class="mb-3">
<label class="form-label">Password</label>
</div>
<div class="mb-3">
</div>
</form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
form-style.css:- .form-box {
#dee2e6; border-radius:
15px;
}
OUTPUT
Practical No:- 3
Design the XML document to store the information of the employees of any business organization
and demonstrate the use of: a) DTD b) XML Schema And display the content in (e.g., tabular
format) by using CSS/XSL.
employees.dtd:-
<!ELEMENT id (#PCDATA)>
employees.xml:-
<employees xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="employees.xsd">
<employee>
<id>101</id>
<name>Rahul Sharma</name>
<designation>Software Engineer</designation>
<department>IT</department>
<salary>60000</salary>
</employee>
<employee>
<id>102</id>
<name>Priya Verma</name>
<designation>HR Manager</designation>
<department>HR</department>
<salary>75000</salary>
</employee>
<employee>
<id>103</id>
<name>Amit Joshi</name>
<designation>Accountant</designation>
<department>Finance</department>
<salary>55000</salary>
</employee>
</employees>
employees.xsd:-
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employees">
<xs:complexType>
<xs:sequence>
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
employees.xsl:-
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Employee Details</title>
<style> body {
padding: 20px;
} table {
border-collapse: collapse;
auto;
th, td {
center;
th {
background-color: #f44336;
color: white;
tr:nth-child(even) {
background-color: #f2f2f2;
</style>
</head>
<body>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Designation</th>
<th>Department</th>
<th>Salary</th>
</tr>
<xsl:for-each select="employees/employee">
<tr>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="designation"/></td>
<td><xsl:value-of select="department"/></td>
<td>₹<xsl:value-of select="salary"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT
Practical No:- 4
Implement an application in Java Script using following: a) Design UI of application using HTML, CSS
etc. b) Include Java script validation c) Use of prompt and alert window using Java Script e.g., Design
and implement a simple calculator using Java Script for operations like addition, multiplication,
subtraction, division, square of number etc. a) Design calculator interface like text field for input and
output, buttons for numbers and operators etc. b) Validate input values c) Prompt/alerts for invalid
values etc.
index.html:-
<!DOCTYPE html>
<html lang="en">
<head>
<title>Modern Calculator</title>
</head>
<body>
<div class="calculator">
<div class="buttons">
<button onclick="clearDisplay()">C</button>
<button onclick="append('%')">%</button>
<button onclick="backspace()">←</button>
<button onclick="append('/')">÷</button>
<button onclick="append('7')">7</button>
<button onclick="append('8')">8</button>
<button onclick="append('9')">9</button>
<button onclick="append('*')">×</button>
<button onclick="append('4')">4</button>
<button onclick="append('5')">5</button>
<button onclick="append('6')">6</button>
<button onclick="append('-')">−</button>
<button onclick="append('1')">1</button>
<button onclick="append('2')">2</button>
<button onclick="append('3')">3</button>
<button onclick="append('+')">+</button>
<button onclick="append('0')">0</button>
<button onclick="append('.')">.</button>
</div>
</div>
<script src="script.js"></script>
width: 320px;
out;
} button:hover { background-color:
scale(1.05);
}
.equal { grid-column: span
2; background-color:
#00b894;
} .equal:hover {
background-color: #00a37c;
document.getElementById("display").value += value;
} function clearDisplay() {
document.getElementById("display").value = "";
document.getElementById("display"); display.value =
display.value.slice(0, -1);
document.getElementById("display");
try { display.value =
eval(display.value);
} catch { alert("Invalid
expression!"); display.value
= "";
}
OUTPUT
Practical No:- 5
Implement the sample program demonstrating the use of Servlet. e.g., Create a database table eBook shop
(book_id, book_title, book_author, book_price, quantity) using database like Oracle/MySQL etc. and display
(use SQL select query) the table content using servlet.
index.html:-
<!DOCTYPE html>
<html ng-app="app">
<head>
"//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"/>
content/app.css" rel="stylesheet"/>
</head>
<body>
<div class="jumbotron">
<div class="container">
'success', 'alert-danger':
ng-if="flash" ng-
bind="flash.message">
</div>
<div ng-view></div>
</div>
</div>
</div>
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="//code.angularjs.org/1.6.0/angular.min.js"></script>
<script src="//code.angularjs.org/1.6.0/angular-route.min.js"></script>
<script src="//code.angularjs.org/1.6.0/angular-cookies.min.js"></script>
<script src="//cdn.rawgit.com/cornflourblue/angular-registration-login example/master/app.js"></script>
services/authentication.service.js"></script>
services/flash.service.js"></script>
services/user.service.local-storage.js"></script>
<script src="//cdn.rawgit.com/cornflourblue/angular-registration-login
example/master/home/home.controller.js"></script>
<script src="//cdn.rawgit.com/cornflourblue/angular-registration-login
example/master/login/login.controller.js"></script>
<script src="//cdn.rawgit.com/cornflourblue/angular-registration-login
example/master/register/register.controller.js"></script>
</body>
</html>
home.view.html:-
<h1>Hi {{vm.user.firstName}}!</h1>
<ul>
- <a ng-click="vm.deleteUser(user.id)">Delete</a>
</li>
</ul>
<p> </p>
Login.view.html:-
<h2>Login</h2>
}">
<label for="username">Username</label>
required />
block">Username is required</span>
</div>
}">
<label for="password">Password</label>
required />
required</span>
</div>
<div class="form-actions">
primary">Login</button>
</div>
</form></div>
app.js:- (function
() {
'use strict';
angular
config($routeProvider, $locationProvider) {
$routeProvider
.when('/', { controller:
'HomeController', templateUrl:
'home/home.view.html',
controllerAs: 'vm'
})
.when('/login', { controller:
'LoginController', templateUrl:
'login/login.view.html',
controllerAs: 'vm'
})
.when('/register', { controller:
'RegisterController', templateUrl:
'register/register.view.html',
controllerAs: 'vm'
})
if ($rootScope.globals.currentUser) {
$rootScope.globals.currentUser.authdata; // jshintignore:line
redirect to login page if not logged in and trying to access a restricted page
!loggedIn) {
$location.path('/login');
});
}
})();
OUTPUT:-
PRACTICLE NO : 6
Implement the program demonstrating the use of JSP. e.g., Create a database table students_info (stud_id,
stud_name, class, division, city) using database like Oracle/MySQL etc. and display (use SQL select
query) the table content using JSP.
Head.html:-
<center>
</center>
Menu.html:-
<!DOCTYPE html>
<html>
<body bgcolor="skyblue">
</body>
</html>
Display.html:-
<center>
</center>
MainPage.html:-
<frameset rows="20%,80%">
<frameset cols="20%,80%">
</frameset>
Insert.java:- import
java.io.*; import
java.sql.*; import
javax.servlet.*; import
javax.servlet.http.*;
public class Insert extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res)
PrintWriter pw = res.getWriter();
value='Insert'>"); pw.println("</form>");
String id = req.getParameter("bookid");
if (id != null && name != null && author != null && price != null) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Successfully!</h3>");
con.close();
} catch (Exception e) {
Delete.java:- import
java.io.*; import
java.sql.*; import
javax.servlet.*; import
javax.servlet.http.*;
public class Delete extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse
PrintWriter pw = res.getWriter();
value='Delete'>"); pw.println("</form>");
String id = req.getParameter("bookid");
if (id != null) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
con.close();
} catch (Exception e) {
Update.java:- import
java.io.*; import
java.sql.*; import
javax.servlet.*; import
javax.servlet.http.*;
res.setContentType("text/html");
PrintWriter pw = res.getWriter();
value='Update'>"); pw.println("</form>");
String id = req.getParameter("bookid");
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "");
con.close();
} catch (Exception e) {
Display.java:- import
java.io.*; import
java.sql.*; import
javax.servlet.*; import
javax.servlet.http.*;
public class Display extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res)
PrintWriter pw = res.getWriter();
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Statement st = con.createStatement();
border='1'><tr><th>ID</th><th>Name</th><th>Author</th><th>Price</th></tr>");
while (rs.next()) { pw.println("<tr>");
pw.println("</tr>");
pw.println("</table>");
con.close();
} catch (Exception e) {
web.xml:-
<servlet>
<servlet-name>Insert</servlet-name>
<servlet-class>Insert</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Insert</servlet-name>
<url-pattern>/insert</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Delete</servlet-name>
<servlet-class>Delete</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Delete</servlet-name>
<url-pattern>/delete</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Update</servlet-name>
<servlet-class>Update</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Update</servlet-name>
<url-pattern>/update</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Display</servlet-name>
<servlet-class>Display</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Display</servlet-name>
<url-pattern>/display</url-pattern>
</servlet-mapping>
</web-app>
OUTPUT
PRACTICLE NO : 7
Build a dynamic web application using PHP and MySQL. a. Create database tables in MySQL and create
connection with PHP b. Create the add, update, delete and retrieve functions in the PHP web app
interacting with MySQL database.
index.jsp:-
<!DOCTYPE html>
<%
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver").newInstance(); conn =
Integer.parseInt(request.getParameter("ID"));
String query = "INSERT INTO student_info (stud_id, stud_name, class, division, city) VALUES (" +
Stud_Id + ", '" + Stud_name + "', '" + Stud_class + "', '" + division + "', '" + Stud_city + "')";
%>
<html>
<head>
</head>
<body>
<center>
<h2>Student List</h2>
<th>Sr. No.</th>
<th>ID</th>
<th>Name</th>
<th>Class</th>
<th>Division</th>
<th>City</th>
</tr> <%
int num = 1;
while (rs.next()) {
%>
<tr>
</tr>
<%
num++;
rs.close();
stmt.close();
conn.close();
%>
</table>
<br>
</center>
</body>
</html>
<head>
{ if (Form_obj.ID.value.length == 0) {
if (Form_obj.sname.value.length == 0) {
if (Form_obj.sclass.value.length == 0) {
if (Form_obj.div.value.length == 0) {
if (Form_obj.city.value.length == 0) {
return true;
</script>
</head>
<body>
<center>
<table>
<tr>
</td>
</tr>
<tr>
<td>Student ID:</td>
</tr>
<tr>
<td>Student Name:</td>
</tr>
<tr>
<td>Student Class:</td>
</tr>
<tr>
<td>Student Division:</td>
</tr>
<tr>
<td>Student City:</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</form>
</center>
</body>
</html>
<% } %>
OUTPUT
PRACTICLE NO : 8
Design a login page with entries for name, mobile number email id and login button. Use struts and
perform following validations a. Validation for correct names b. Validation for mobile numbers c.
Validation for email id d. Validation if no entered any value e. Re-display for wrongly entered values with
message f. Congratulations and welcome page upon successful entries
connect.php:-
<?php
mysqli_error($connection)); }
mysqli_error($connection)); }
?>
Main.php:- <?php
require('connect.php');
".$_SERVER['PHP_SELF']);
?>
<html>
<head>
<script type="text/javascript">
function edt_id(id) {
window.location.href='Update_data.p
hp?edit_id=' + id;
}
?')) {
window.location.href='Main.php?delete_id=' + id;
</script>
</head>
<body>
</table>
<th>Name</th>
<th>Age</th>
<th>City Name</th>
<th>Salary</th>
<th colspan="2">Operations</th>
</tr>
<?php
if(mysqli_num_rows($result_set) > 0) {
while($row = mysqli_fetch_row($result_set)) {
?>
<tr>
</tr>
<?php
} else {
?>
<tr>
</tr>
<?php
?>
</table>
</body>
</html>
CreateData.html:-
<html>
<head>
<title>Create Employee</title>
</head>
<body>
</table>
<tr><td>Select Gender:</td>
<td><select name="sex"><option>Male</option><option>Female</option></select></td>
</tr>
<tr><td>Employee Salary:</td><td><input type="text" maxlength="6" name="sal"/></td></tr>
</table>
</form>
</body>
</html>
$ename = $_POST['name'];
$age = $_POST['age'];
$sex = $_POST['sex'];
$salary = $_POST['sal'];
$query = "INSERT INTO employee(name, age, sex, salary) VALUES('$ename', $age, '$sex', $salary)";
your data');</script>";
window.location.href='index.php';</script>";
?>
Update_data.php:-
<html>
<head>
<title>Update Employee</title>
</head>
<body>
<tr><td>Select Gender:</td>
<td><select name="sex"><option>Male</option><option>Female</option></select></td>
</tr>
<tr align="center">
</tr>
</table>
</form>
</body>
</html>
<?php
require('connect.php'); if
(isset($_GET['edit_id'])) {
$fetched_row = mysqli_fetch_array($result_set);
if (isset($_POST['update'])) {
$ename = $_POST['name'];
$age = $_POST['age'];
$sex = $_POST['sex'];
$salary = $_POST['sal'];
data');</script>";
}
if (isset($_POST['cancel'])) {
header("Location: Main.php");
?>
Stylesheet1.css:- h1 {
font-size: 300%;
h2 { font-family: Poor
td { font-family: Bodoni
input { font-family:
.ab { background-color:
Gray;
color: white;
margin: 8px 0;
opacity: 0.9;
}
select { font-family:
OUTPUT
PRACTICLE NO : 9
Design an application using Angular JS. e.g., Design registration (first name, last name, username, and
password) and login page using Angular JS.
Login.jsp:-
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Login Page</title>
</head>
<body>
<center>
<h3>Navsahydri pune</h3>
<a:submit value="Login"/>
</a:form>
</center>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Welcome</title>
</head>
<body>
<center>
<h1>Congratulations!!!</h1>
</center>
</body>
</html>
LoginProg.java:- package
org.struts;
import com.opensymphony.xwork2.ActionSupport;
return UN;
this.UN = UN;
return MN;
this.MN = MN;
} public String
getEmail() { return
email;
this.email = email;
else if (!getMN().equals("1234567890"))
(!getEmail().equals("[email protected]"))
else {
struts.xml:-
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.custom.i18n.resources" value="LoginProg"/
<result name="success">/Welcome.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
OUTPUT
PRACTICLE NO : 10
Design and implement a business interface with necessary business logic for any web application using
EJB. e.g., Design and implement the web application logic for deposit and withdraw amount transactions
using EJB.
Login.jsp —
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Login Page</title>
</head>
<body>
<center>
<a:submit value="Login"/>
</a:form>
</center>
</body>
</html>
Welcome.jsp:-
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Welcome</title>
</head>
<body>
<center>
<h1>Congratulations!!!</h1>
</center>
</body>
</html>
LoginProg.java:- package
org.struts;
import com.opensymphony.xwork2.ActionSupport;
java.util.regex.Pattern;
String email;
SUCCESS;
this.UN = UN; }
(getUN().length() == 0)
addFieldError("UN", "User
if
(!getUN().equals("Admin"))
addFieldError("UN",
(!getEmail().equals("[email protected]"))
else {
struts.xml:-
<struts>
<result name="success">/Welcome.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
OUTPUT