WTL Lab Manual
WTL Lab Manual
WTL Lab Manual
Lab Manual of
Semester: VI
(Version – 1)
Preparation of Lab Manual Contributed By
Sr Name of experiment Faculty
No name
1 Prof
Case study:Visit various websites available online for different client Ashwini
projects, identify and note down the evaluation results in following Bundele
format and note down and learn and conclude different website design
issues that should be considered while designing a web site.
2 1. Implement a web page index.htm for any client website (e.g., a Prof
restaurant website project) using following: Ashwini
a. HTML syntax: heading tags, basic tags and attributes, frames, Bundele
tables, images, lists, links for text and images, forms etc.
b) XML Schema
4 Prof V. S.
Implement an application in Java Script using following: Gaikwad
a) Design UI of application using HTML, CSS etc.
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.
5 Prof V. S.
Implement the sample program demonstrating the use of Servlet. Gaikwad
e.g., Create a database table ebookshop (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.
6 Implement the program demonstrating the use of JSP. VS
e.g., Create a database table students_info (stud_id, stud_name, class, division, Gaikwad
city) using database like Oracle/MySQL etc. and display (use SQL select query)
the table content using JSP.
7 Prof V. S.
Build a dynamic web application using PHP and MySQL. Gaikwad
Create the add, update, delete and retrieve functions in the PHP web app
interacting with MySQL database
8 Design a login page with entries for name, mobile number email id and login Prof. P T
button. Use struts and perform following validations Kohok
a. Validation for correct names
10 Design and implement a business interface with necessary business logic for any Prof. P T
web application using EJB. Kohok
e.g., Design and implement the web application logic for deposit and withdraw
amount transactions using EJB.
11 Mini Project: Design and implement a dynamic web application for any Prof. P. J
business functionality by using web development technologies that you have Jambhulkar
learn in the above given assignments.
Savitribai Phule Pune University
Third Year of Computer Engineering (2019 Course)
CO-PO Mapping:
Index
Sr Name of assignment
No.
1 Case study:
Visit various websites available online for different client projects, identify and
note down the evaluation results in following format and note down and learn and
conclude different website design issues that should be considered while designing
a web site.
Sr No. Website URL Purpose of website Things liked in Things disliked overall evaluation
the website in the website (Good/Bad)
2 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
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.
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.
CE-P:F:-LTL/UG/01/R0
ASSIGNMENT NO: 1
PROBLEM Visit various websites available online for different client projects,
STATEMEN identify and note down the evaluation results in following format
T and note down and learn and conclude different website design
/DEFINITION issues that should be considered while designing a web site.
Most of the times these terms Web Server and Application server are used interchangeably.
Following are some of the key differences in features of Web Server and Application Server:
● Web Server is designed to serve HTTP Content. App Server can also serve HTTP Content but is not
limited to just HTTP. It can be provided other protocol support such as RMI/RPC
● Web Server is mostly designed to serve static content, though most Web Servers have plugins to support
scripting languages like Perl, PHP, ASP, JSP etc. through which these servers can generate dynamic HTTP
content.
● Most of the application servers have Web Server as integral part of them, that means App Server can do
whatever Web Server is capable of. Additionally App Server have components and features to support
Application level services such as Connection Pooling, Object Pooling, Transaction Support, Messaging
services etc.
● As web servers are well suited for static content and app servers for dynamic content, most of the
production environments have web server acting as reverse proxy to app server. That means while
servicing a page request, static contents (such as images/Static HTML) are served by web server that
interprets the request. Using some kind of filtering technique (mostly extension of requested resource) web
server identifies dynamic content request and transparently forwards to app server
Components of Tomcat
1. Catalina : It is the Servlet Container of Tomcat.
2. Coyote : Coyote acts as a connector and supports HTTP 1.1
3. Jasper : It is the Tomcat‘s JSP Engine.
4. Cluster : A component for load balancing to manage large applications.
5. High availability : A Tomcat component to schedule system upgrades and changes without affecting live
environment.
6. Web Application : Manage Sessions, Support deployment across different environments.
This article will walk you throughout the process of installing Apache Tomcat 8 (i.e. 8.5.14) on Linux systems,
which includes RHEL, CentOS, Fedora, Debian, Ubuntu, etc.
Step 1: Installing Java 8
1. Before installing Tomcat make sure you have the latest version of Java Development Kit (JDK) installed and
configured on the system. It is preferred to use oracle Java.
To install latest Oracle Java JDK (jdk-8u131) on Linux, you may like to refer our recent posts on Oracle jdk/jre/jar
Once ‗Tomcat Started‗, you can point your browser to http://127.0.0.1:8080 and you should see something as:
Getting started with JBoss AS 7 in Fedora
When you connect to the management console, the server will send a secret key challenge to the client. The client
can only pass the challenge if it has physical direct access to the file system and the same permissions as the user
running the server. Otherwise, you'd need to create and use a proper management user.
Stop the JBoss AS 7 system service:
jboss-as-cp -l $HOME/jboss-as-user-instance
JBOSS_BASE_DIR=$HOME/jboss-as-user-instance /usr/share/jboss-as/bin/standalone.sh
-c standalone-web.xml
jboss-cli -c
References:
1. https://tutorialforlinux.com/how-to-install-apache-tomcat-java-ee-server-on-linux-distributions-easy-
guides/
2. https://www.tutorialspoint.com/articles/tag/apache-tomcat-server
3. www.w3schools.com
Oral Questions:
1. How to start / stop Apache tomcat?
2. What is the default port for HTTP and HTTPs
3. List the important configuration file name of tomcat.
4. How to check version of running Apache tomcat?
5. How to know if web server is running?
6. How to install Apache web server?
7. Differentiate between web server and application server.
8. What is Glassfish application server?
9. How to start and stop the Default Domain?
10. How to start administration console in GlassFish?
ASSIGNMENT NO: 2
Implement a web page index.htm for any client website (e.g., a restaurant website
project) using following:
PROBLEM
STATEMENT 1. HTML syntax: heading tags, basic tags and attributes, frames, tables, images,
/DEFINITION lists, links for text and images, forms etc.
2. Use of Internal CSS, Inline CSS, External CSS
Implement a web page index.htm for any client website (e.g., a restaurant website project) using following:
1. HTML syntax: heading tags, basic tags and attributes, frames, tables, images, lists, links for text and images,
forms etc.
2. Use of Internal CSS, Inline CSS, External CSS
Objectives:
1) To develop web pages using HTML
2) To optimize page styles & layout with CSS
Outcomes:
1) Define the key terms relevant to coding HTML and CSS, including: tag, attribute, element, entity, selector,
header, table, ordered list, unordered list, link, heading, paragraph ; et cetra .
2) Describe the function of common tags & styles in short snippets of code & predict the output of the same .
3) Apply Internal,external and inline CSS to file
4) Define & compare the concepts of multimedia , hypermedia & hypertext .
Theory:
Introduction:
Files that travel across the largest network in the world , the Internet , & carry information from ‗ Server ‘ to ‗
Client ‘ that requested them are called ‗ Web pages / HTML documents ‘ . Individual who develops these web
pages is called ‗ Web Developer ‘ . Web Pages are created using HTML syntax . The organization of web pages
into directories & files stored on the HDD of a computer is called ‗ Web Site ‘ creation . As studied in previous
assignment , the Server Computer runs special software called ‗ Web Server ‘ software that allows :
▪ Web Site Management
▪ Accept a client‘s request for information
▪ Respond to a client‘s request by providing the page with the required information
Computers that offer the facility to read information stored in web pages are called ‗ Web Clients ‘ . Web Clients
run special software called a ‗ Browser ‘ that allows to :
▪ Connect to an appropriate Server
▪ Query the Server for the information to be read
▪ Provides an interface to read the information returned by the Server
HTML :
The language used to develop web pages is called HyperText Markup Language which is interpreted by a Browser
. HTML is a set of special codes that can be embedded in text to add formatting & linking information . HTML
Tags are instructions that are embedded directly into text of document . It is a signal to a browser that it should do
something other than just throw text up on the screen . HTML tags can be of two types :
Paired Tags Singular Tags
Some HTML tags require additional information to be supplied to them that are known as Attributes of a tag .
Attribute(s) are written immediately following the tag , separated by a space . The creation of textual content of
Web Site is done in any editor viz; Notepad / Eclipse / IDE ; et cetra & saved as filename.htm / .html file .
Advantages:
✔ ability to make global changes to all documents from a single location
✔ greater author control over appearance of text & its placement on the page
✔ reduced clutter of multiple opening & closing tags on individual text elements
✔ simplified modification of page design through style editing
✔ eliminating the need for clumsy HTML workarounds to achieve basic layout effects
✔ great improvement of the design potential for HTML pages without introducing a large no. of new
proprietary tags or compromising ability of other browser to effectively display the document text
Advantages of Schemas:
✔ easier to validate the correctness of data
✔ easier to work with data from database
✔ easier to define data facets & data patterns
✔ easier to convert data between different data types
References:
1. Web enabled commercial application development using HTML , DHTML , JavaScript , Perl CGI by Ivan
Bayross
2. Musiciano C. Kennedy B., ‗ HTML & XHTML ‘ , 5th or higher edition , O‘Reilly / SPD Publications ,
ISBN B1 – 7366 – 517 – 1
3. Learning XML by Erik T. Ray , O‘reilly
4. Internet & World Wide Web , How to Programe , 3rd or higher edition , H. M. Deitel , P. J. Deitel , A. B.
Goldberg , Pearson education
5. McKinnon A., McKinnon L., ‗ XML ‘ , Vikas Publishing House , 2004 , ISBN 981 – 254 – 299 –
X https://www.w3schools.com/xml/
Oral Questions:
1. Compare HTML with XML.
2. What is the difference between form get and form post?
3. What is the importance of the HTML DOCTYPE?
4. What is web application?
5. What is markup language?
6. What is DOM document & XPath?
7. Can we have empty XML tag?
8. Can we replace HTML with XML?
1) Create a specimen of a corporate web page . Divide the browser screen into two frames . The frame on the
left will be a menu consisting of hyperlinks . Clinking on any one of these links will lead to a new page , which
must open in the target frame , which is on RHS .
Content of Frame 4
Content of Frame 2
Content of Frame 5
Solution :
<html>
<head> <title> Nested frames </title> </head>
<frameset cols = ― 40% ‖ , * > <framset rows = ― 50% ‖ , * >
<frame src = ―frame1.html‖/> <frame src = ―frame2.html/>‖
</frameset>
<frameset rows = ― 20% ‖ , ― 35% ‖ , *>
<frame src = ―frame3.html‖/> <frame src = ―frame4.html‖/>
<frame src = ―frame5.html‖/> </frameset> </frameset> </html>
3) Design following table which includes caption , border , cellpadding & cellspacing
Answer =
5) XML design
Oral questions:
PROBLEM 1. Design the XML document to store the information of the employees of any
STATEMEN business organization and demonstrate the use of:
T
/DEFINITION 2. a) DTD
3. b) XML Schema
S/W PACKAGES Operating System open source Fedora 20 Networked computer with internet
AND access
HARDWARE Editor : IDE : Netbeans 8.1
APPARATUS Web browser Mozilla Firefox, Google Chrome
USED
https://www.w3schools.com/xml/xml_schema.asp
REFERENCES https://www.geeksforgeeks.org/displaying-xml-using-css/
INSTRUCTIONS ● Title
FOR ● Problem Statement
WRITING ● Theory
JOURNAL ● Design part
● Troubleshooting ( if any )
● Conclusion
● References
XML
An Introduction to XML
Let‘s see what‘s so special about XML, what we can achieve with it and which other technologies play well with
it.
What is XML?
XML is a software- and hardware-independent tool for storing and transporting data.
Why XML?
It is a dynamic markup language. It is used to transform data from one form to another form.
An XML file can be displayed using two ways. These are as follows :-
1. Cascading Style Sheet
2. Extensible Stylesheet Language Transformation
Displaying XML file using CSS :
CSS can be used to display the contents of the XML document in a clear and precise manner. It
gives the design and style to whole XML document.
3. Basic steps in defining a CSS style sheet for XML :
For defining the style rules for the XML document, the following things shoulde be done :-
a. Define the style rules for the text elements such as font-size, color, font-weight, etc.
b. Define each element either as a block, inline or list element, using the display property of
CSS.
c. Identify the titles and bold them.
4. Linking XML with CSS :
In order to display the XML file using CSS, link XML file with CSS. Below is the syntax for linking
the XML file with CSS:
In this example, the XML file is created that contains the information about five books and displaying the
XML file using CSS.
● XML file :
Creating employees.xml as :-
</employees>
● In the above example, employees.xml is linked with Rule.css
which contains the corresponding style sheet rules.
● CSS FILE :
Creating Rule.css as:-
employees {
color: white;
background-color : gray;
width: 100%;
}
heading {
color: green;
font-size : 40px;
background-color : powderblue;
}
heading, title, author, age {
display : block;
}
title {
font-size : 25px;
font-weight : bold;
}
DTD
An XML document validated against a DTD is both "Well Formed" and "Valid".
What is a DTD?
A DTD defines the structure and the legal elements and attributes of an XML document.
A "Valid" XML document is "Well Formed", as well as it conforms to the rules of a DTD:
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
</note>
the DOCTYPE declaration above contains a reference to a DTD file. The content of the DTD file is shown
and explained below.
XML DTD
The purpose of a DTD is to define the structure and the legal elements and attributes of an XML document:
<!DOCTYPE note
<!ELEMENT to (#PCDATA)>
]>
● !DOCTYPE note - Defines that the root element of the document is note
● !ELEMENT note - Defines that the note element must contain the elements: "to, from, heading,
body"
● !ELEMENT to - Defines the to element to be of type "#PCDATA"
● !ELEMENT from - Defines the from element to be of type "#PCDATA"
● !ELEMENT heading - Defines the heading element to be of type "#PCDATA"
● !ELEMENT body - Defines the body element to be of type "#PCDATA"
With a DTD, independent groups of people can agree to use a standard DTD for interchanging data.
With a DTD, you can verify that the data you receive from the outside world is valid.
When you are experimenting with XML, or when you are working with small XML files, creating DTDs
may be a waste of time.
If you develop applications, wait until the specification is stable before you add a DTD. Otherwise, your
software might stop working because of validation errors.
XML SCHEMA
An XML Schema describes the structure of an XML document, just like a DTD.
An XML document validated against an XML Schema is both "Well Formed" and "Valid".
XML Schema
<xs:element name="note">
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
The Schema above is interpreted like this:
With XML Schema, your XML files can carry a description of its own format.
With XML Schema, independent groups of people can agree on a standard for interchanging data.
One of the greatest strengths of XML Schemas is the support for data types:
Another great strength about XML Schemas is that they are written in XML:
● You don't have to learn a new language
● You can use your XML editor to edit your Schema files
● You can use your XML parser to parse your Schema files
● You can manipulate your Schemas with the XML DOM
● You can transform your Schemas with XSLT
References:
https://www.w3schools.com/xml/xml_schema.asp
https://www.geeksforgeeks.org/displaying-xml-using-css/
Oral Questions:
1. What is xml?
2. What is css?
3. What is dtd?
4. How xml and dtd are different?
5. Is xml a W3C standard?
6. Which is the starting point of code execution in xml?
ASSIGNMENT NO: 4
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.
S/W PACKAGES Operating System open source Fedora 20 Networked computer with internet
AND access
HARDWARE Editor : IDE : Netbeans 8.1
APPARATU Web browser Mozilla Firefox, Google Chrome
S USED
1. https://www.javatpoint.com/javascript-calculator
REFERENCES 2.https://codeburst.io/making-a-calculator-with-basic-html-css-and-javascript-
part-1-1e4288f0bea1
3. https://www.geeksforgeeks.org/design-a-tip-calculator-using-html-css-and-
javascript/
INSTRUCTIONS ● Title
FOR ● Problem Statement
WRITING ● Theory
JOURNAL ● Architecture diagrams ( design part )
● Troubleshooting ( if any )
● Conclusion
● References
Theory:
JavaScript Calculator
As we know, the Calculator is a portable device used in our daily life to perform various mathematical
functions such as addition, subtraction, multiplication, division, root, etc. However, we have scientific or
sophisticated calculators used to solve complex tasks such as trigonometry functions, degrees, exponential
operators, log functions, hyperbolic functions, square root, and so on. In this topic, we will create a calculator
program in JavaScript.
<!-- Create a simple Program to build the Calculator in JavaScript using with HTML and CSS web
languages. -->
<!DOCTYPE html>
<html lang = "en">
<head>
<title> JavaScript Calculator </title>
<style>
h1 {
text-align: center;
padding: 23px;
background-color: skyblue;
color: white;
}
#clear{
width: 270px;
border: 3px solid gray;
border-radius: 3px;
padding: 20px;
background-color: red;
}
.formstyle
{
width: 300px;
height: 530px;
margin: auto;
border: 3px solid skyblue;
border-radius: 5px;
padding: 20px;
}
input
{
width: 20px;
background-color: green;
color: white;
border: 3px solid gray;
border-radius: 5px;
padding: 26px;
margin: 5px;
font-size: 15px;
}
#calc{
width: 250px;
border: 5px solid black;
border-radius: 3px;
padding: 20px;
margin: auto;
}
</style>
</head>
<body>
<h1> Calculator Program in JavaScript </h1>
<div class= "formstyle">
<form name = "form1">
<!-- This input box shows the button pressed by the user in calculator. -->
<input id = "calc" type ="text" name = "answer"> <br> <br>
<!-- Display the calculator button on the screen. -->
<!-- onclick() function display the number prsses by the user. -->
<input type = "button" value = "1" onclick = "form1.answer.value += '1' ">
<input type = "button" value = "2" onclick = "form1.answer.value += '2' ">
<input type = "button" value = "3" onclick = "form1.answer.value += '3' ">
<input type = "button" value = "+" onclick = "form1.answer.value += '+' ">
<br> <br>
</form>
</div>
</body>
</html>
Here we have created a Calculator program using the JavaScript language, including HTML and CSS
web programming. In this Calculator, we can perform basic operations like addition, multiplication,
subtraction, and division.
Oral Questions:
1. What is the use of html?
2. How to include a file to html page?
3. What is difference between include and require?
4. Require_once(), require(), include(), what is difference between them?
5. How to declare an array in javascript?
6. What is use of in_array() in javascript?
ASSIGNMENT NO: 5
Develop a web application using Servlets e.g. Create a database table ebookshop
PROBLEM (book_id, book_title, book_author, book_price, quantity) using database like
STATEMEN Oracle/MySQL etc. and display (use SQL select query) the table content using
T servlet.
/DEFINITION
● To understand server side programming using Servlets
OBJECTIVE ● To explore the usage of Servlets in web applications
S/W PACKAGES Operating System open source Fedora 20 Networked computer with internet
AND HARDWARE access
APPARATUS Editor : IDE : Netbeans 8.1/ Eclipse for web development
USED Web browser Mozilla Firefox, Google Chrome
1. https://www.javatpoint.com
REFERENCES 2. https://dzone.com/tutorials
INSTRUCTIONS ● Title
FOR ● Problem Statement
WRITING ● Theory
JOURNAL ● Architecture diagrams ( design part )
● Test Cases( if any )
● Conclusion
● References
Theory:
What is a Servlet?
● Servlet is a technology which is used to create a web application.
● Servlet is an API that provides many interfaces and classes including documentation.
● Servlet is an interface that must be implemented for creating any Servlet.
● Servlet is a class that extends the capabilities of the servers and responds to the incoming requests. It can
respond to any requests.
● Servlet is a web component that is deployed on the server to create a dynamic web page.
Advantages of Servlet:
There are many advantages of Servlet over CGI. The web container creates threads for handling the multiple requests
to the Servlet. Threads have many benefits over the Processes such as they share a common memory area, lightweight,
cost of communication between the threads are low. The advantages of Servlet are as follows:
1. Better performance: because it creates a thread for each request, not process.
2. Portability: because it uses Java language.
3. Robust: JVM manages Servlets, so we don't need to worry about the memory leak, garbage collection, etc.
4. Secure: because it uses java language.
DemoServlet.java:
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;
pw.println("<html><body>");
pw.println("Welcome to servlet");
pw.println("</body></html>");
Conclusion: Hence, we have studied and implemented Servlets for creating web applications.
References:
https://www.javatpoint.com/steps-to-create-a-servlet-using-tomcat-server
ASSIGNMENT NO: 6
Develop a web application using JSP e.g. Create a database table students_info
PROBLEM (stud_id, stud_name, class, division, city) using database like
STATEMEN Oracle/MySQL etc. and display (use SQL select query) the table content
T using JSP.
/DEFINITION
● Understand the basic functionalities of JSP
OBJECTIVE ● Analyze the difference between JSP and Servlets for server side programming
S/W PACKAGES Operating System open source Fedora 20 Networked computer with internet
AND HARDWARE access
APPARATUS Editor : IDE : Netbeans 8.1/ Eclipse for web development
USED Web browser Mozilla Firefox, Google Chrome
1. https://www.javatpoint.com
REFERENCES 2. https://dzone.com/tutorials
INSTRUCTIONS ● Title
FOR ● Problem Statement
WRITING ● Theory
JOURNAL ● Architecture diagrams ( design part )
● Test Cases( if any )
● Conclusion
● References
Theory:
Java Server Pages (JSP):
It is a server side programming technology that is used to create dynamic web-based applications. JSP have right to
use the complete Java APIs, including the JDBC API to access the databases.
It is a technology that helps software developers to create dynamic web pages based on HTML, XML and other
document types. It was released in 1999 by Sun Microsystems. It is just like a PHP and ASP, but it uses the Java
programming language.
A JSP element is a type of java servlet that is designed to accomplish the role of a user interface for a java web
application. Web developers write JSPs as text files that combine HTML or XHTML code, XML elements, and rooted
JSP actions and commands.
Using JSP, you can collect input from users through web page forms, current records from a database or another
source and create web pages dynamically.JSP tags can be used for different purposes, such as retrieving information
from a database or registering user preferences, accessing JavaBeans components, passing control between pages, and
sharing information between requests, pages etc.
Architecture of JSP
Syntax of JSP:
Declaration tags in JSP function as identification containers for the functions, methods and variables in JSP pages.
Because these tags identify rather than generate output, you will most often find declaration tags working in
combination with expression or scriptlet tags. Syntax options include the simple "<%! jsp declaration %>" and the
XML alternative "jsp:declaration…."
Expression tags signal JSP to convert a Java statement – also called an expression – into a string and display the
output. Syntax options include the simple "<%= Java statement %>" and the XML alternative "jsp:expression…."
Directives – or message tags – are instructional tags that contain two parts: type and attribute. Type can be "page,"
which gives page-specific processing directions, "Include," which provides specific file names or "Tag Library," which
identifies the tag library you want to use on the current page. Syntax options include the simple "<%@ dir-type dir-attr
%> and the XML alternative "<jsp:directive.dir_type dir_attr />."
Scriptlet tags allow you to embed any valid Java source code in JSP server pages. The code within the tags executes in
consecutive order on the server side and is available for client access through a Web browser. Syntax options include
the simple "<% Java code %> and the XML alternative "jsp:scriptlet Java code ."
Flow control tags function the same as – and are an alternative to – scriptlets. Unlike scriptlets, however, flow control
tags allow you to control the order in which statements run. The conditional tags "if" and "choose" and the iterator tags
"forEach" and "forTokens" are all examples of JSP flow control tags. The syntax framework for each includes
<c:tag_type tag_attribute> Java code . For example, when you use an "if" statement, the correct syntax is <c: if test=
"$test parameters"> Java code </c: if > where test= is the type and "$test parameters" identifies tag attributes.
Action tags can tell JSP to transfer control between pages, set or get properties, facilitate browser independent support
for Java applets and make it possible to use server-side JavaBeans. Of the many available action tags, the most
common are the include directive, the forward tag, which transfers control to a dynamic or static URL and the useBean
tag, which allows a JSP to create or receive an instance of a reusable software component that works with Java called a
JavaBean. The only syntax option for an action tag is the XML version: "jsp:useBean Java body ."
Comment tags are for "information only" and do not appear on JSP pages. Use them for clarification or documentation
and view them by right clicking on a Web page and accessing the "view source" option. The only syntax option for a
comment tag is the simple version: <%/ comments go here />.
Conclusion: Hence, we have performed the dynamic web application using JSP.
References:
https://www.techwalla.com/articles/list-of-jsp-tags
Questions:
1. What is JSP?
2. What is Servlet?
3. What is the purpose of MySQL?
4. What is database?
5. What is the syntax of JSP?
6. How do we connect JSP file to database?
ASSIGNMENT NO: 7
INSTRUCTIONS ● Title
FOR ● Problem Statement
WRITING ● Theory
JOURNAL ● Architecture diagrams ( design part )
● Test Cases( if any )
● Conclusion
● References
Theory:
PHP:
The PHP Hypertext Preprocessor (PHP) began as a little open source venture that advanced as an ever
increasing number of individuals discovered how valuable it was. Rasmus Lerdorf released the principal form
of PHP route in 1994. PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
PHP is a server side scripting dialect that is installed in HTML. It is utilized to oversee dynamic substance,
databases, session following, even form whole internet business locales. It is incorporated with various
prevalent databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
PHP is pleasingly zippy in its execution, particularly when gathered as an Apache module on the Unix side.
The MySQL server, once begun, executes even extremely complex questions with colossal outcome sets in
record-setting time.
PHP bolsters a substantial number of real conventions, for example, POP3, IMAP, and LDAP. PHP4 included
help for Java and conveyed question designs (COM and CORBA), making n- level improvement a plausibility
out of the blue. PHP is excusing: PHP dialect tries to be as pardoning as would be prudent. PHP Syntax is C-
Like.
PHP performs framework capacities, i.e. from documents on a framework it can make, open, read, compose,
and close them. PHP can deal with frames, i.e. accumulate information from records, spare information to a
document; through email you can send information, return information to the client.
You include, erase, adjust components inside your database through PHP. Access treats factors and set treats.
Utilizing PHP, you can confine clients to get to a few pages of your site. It can encode information.
Example:
"Hello World" Script in PHP
To get a feel for PHP, first start with simple PHP scripts. Since "Hello, World!" is an essential example, first we will
create a friendly little "Hello, World!" script.
As mentioned earlier, PHP is embedded in HTML. That means that in amongst your normal HTML (or XHTML if
you're cutting-edge) you'll have PHP statements like this –
<html>
<head>
<title> Hello World</title>
</head>
<body>
<?php echo (“Hello Php”); ?>
</body>
</html>
To create and run PHP Web pages three fundamental parts should be introduced on your PC framework.
Web Server − PHP will work with for all intents and purposes all Web Server
programming, including Microsoft's Internet Information Server (IIS) however then
regularly utilized is unreservedly accessible Apache Server. Download Apache for
nothing here − https://httpd.apache.org/download.cgi
Database − PHP will work with for all intents and purposes all database
programming, including Oracle and Sybase yet most regularly utilized is
uninhibitedly accessible MySQL database. Download MySQL for nothing here −
https://www.mysql.com/downloads/
PHP Parser − keeping in mind the end goal to process PHP content directions a parser must be introduced to
create HTML yield that can be sent to the Web Browser. This instructional exercise will manage you how to introduce
PHP parser on your PC.
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$conn->close();
?>
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, firstname, lastname FROM MyGuests";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();
?>
Conclusion: Hence, we have studied how to design and develop small web application using PHP script and MySQL
as backend.
Reference: https://www.w3schools.com/php
Questions:
1. What is the use of "echo" in php?
2. How to include a file to a php page?
3. Differences between GET and POST methods ?
4. What is the use of 'print' in php?
5. What is the difference between Session and Cookie?
6. What are the different errors in PHP?
7. How to print current date and time?
8. What is the difference between sql and Mysql?
9. Why do we use GROUP BY and ORDER BY function in mysql?
10. What is JOIN in MySQL? What are the different types of join?
ASSIGNMENT NO: 7
S/W PACKAGES Operating System: open source Fedora 20 Networked computer with Internet
AND access
HARDWARE Editor : IDE : Netbeans 8.1
APPARATUS Web browser: Mozilla Firefox, Google Chrome
USED
1. https://angular.io/
REFERENCES 2. https://angular.io/tutorial
3. https://www.w3schools.com/angular/angular_intro.asp
4. https://www.tutorialspoint.com/angularjs/index.htm
5. https://www.javatpoint.com/angularjs-tutorial
INSTRUCTIONS ● Title
FOR ● Problem Statement
WRITING ● Theory
JOURNAL ● Design part
● Troubleshooting ( if any )
● Conclusion
● References
AngularJS
Angular (commonly referred to as "Angular 4" or "Angular 2") is a TypeScript-based open-source front-end web
application platform led by the Angular Team at Google and by a community of individuals and corporations.
Angular is a complete rewrite from the same team that built AngularJS.
Architecture Overview
Angular is a framework for building client applications in HTML and either JavaScript or a language like
TypeScript that compiles to JavaScript.
The framework consists of several libraries, some of them core and some optional.
You write Angular applications by composing HTML templates with Angularized markup, writing component
classes to manage those templates, adding application logic in services, and boxing components and services in
modules.
Then you launch the app by bootstrapping the root module. Angular takes over, presenting your application content
in a browser and responding to user interactions according to the instructions you've provided.
Modules
Angular apps are modular and Angular has its own modularity system called NgModules. NgModules are a big
deal. Every Angular app has at least one NgModule class, the root module, conventionally named AppModule.
While the root module may be the only module in a small application, most apps have many more feature modules,
each a cohesive block of code dedicated to an application domain, a workflow, or a closely related set of
capabilities. An NgModule, whether a root or feature, is a class with an @NgModule decorator.
NgModule is a decorator function that takes a single metadata object whose properties describe the
module. The most important properties are:
● declarations - the view classes that belong to this module. Angular has three kinds of view classes:
components, directives, and pipes.
● exports - the subset of declarations that should be visible and usable in the component templates of other
modules.
● imports - other modules whose exported classes are needed by component templates declared in this
module.
● providers - creators of services that this module contributes to the global collection of services; they
become accessible in all parts of the app.
● bootstrap - the main application view, called the root component, that hosts all other app views. Only the
root module should set this bootstrap property.
Components
A component controls a patch of screen called a view.
For example, the following views are controlled by components:
● The app root with the navigation links.
● The list of heroes.
● The hero editor.
You define a component's application logic—what it does to support the view—inside a class. The class interacts
with the view through an API of properties and methods.
Templates
You define a component's view with its companion template. A template is a form of HTML that tells Angular
how to render the component.
Although this template uses typical HTML elements like <h2> and <p>, it also has some differences. Code like
*ngFor, {{hero.name}}, (click), [hero], and <app-hero-detail> uses Angular's template syntax.
In the last line of the template, the <app-hero-detail> tag is a custom element that represents a new component,
HeroDetailComponent.
The HeroDetailComponent is a different component than the HeroListComponent you've been reviewing. The
HeroDetailComponent (code not shown) presents facts about a particular hero, the hero that the user selects from
the list presented by the HeroListComponent. The HeroDetailComponent is a child of the HeroListComponent.
Metadata
Metadata tells Angular how to process a class. Looking back at the code for HeroListComponent, you can see that
it's just a class. There is no evidence of a framework, no "Angular" in it at all. In fact, HeroListComponent really
is just a class. It's not a component until you tell Angular about it. To tell Angular that HeroListComponent is a
component, attach metadata to the class. In TypeScript, you attach metadata by using a decorator. Here's some
metadata for HeroListComponent
Here is the @Component decorator, which identifies the class immediately below it as a component class. The
@Component decorator takes a required configuration object with the information Angular needs to create and
present the component and its view.
Here are a few of the most useful @Component configuration options:
● selector: CSS selector that tells Angular to create and insert an instance of this component where it finds
a <app-hero-list> tag in parent HTML. For example, if an app's HTML contains <app-hero-list></app-
hero-list>, then Angular inserts an instance of the HeroListComponent view between those tags.
● templateUrl: module-relative address of this component's HTML template, shown above.
● providers: array of dependency injection providers for services that the component requires. This is one
way to tell Angular that the component's constructor requires a HeroService so it can get the list of heroes
to display.
The metadata in the @Component tells Angular where to get the major building blocks you specify for the
component. The template, metadata, and component together describe a view. @Injectable, @Input, and @Output
are a few of the more popular decorators.
Data binding
Without a framework, you would be responsible for pushing data values into the HTML controls and turning user
responses into actions and value updates. Writing such push/pull logic by hand is tedious, error-prone, and a
nightmare to read as any experienced jQuery programmer can attest. Angular supports data binding, a mechanism
for coordinating parts of a template with parts of a component. Add binding markup to the template HTML to tell
Angular how to connect both sides.
As the diagram shows, there are four forms of data binding syntax. Each form has a direction — to the DOM, from
the DOM, or in both directions.
Directives
Angular templates are dynamic. When Angular renders them, it transforms the DOM according to the instructions
given by directives. A directive is a class with a @Directive decorator. A component is a directive- with-a-
template; a @Component decorator is actually a @Directive decorator extended with template-oriented features.
Two other kinds of directives exist: structural and attribute directives. They tend to appear within an element tag
as attributes do, sometimes by name but more often as the target of an assignment or a binding.
Structural directives alter layout by adding, removing, and replacing elements in DOM.
Services
Service is a broad category encompassing any value, function, or feature that your application needs. Almost
anything can be a service. A service is typically a class with a narrow, well-defined purpose. It should do something
specific and do it well.
Examples include:
● logging service
● data service
● message bus
● tax calculator
● application configuration
There is nothing specifically Angular about services. Angular has no definition of a service. There is no service
base class, and no place to register a service. Yet services are fundamental to any Angular application. Components
are big consumers of services.
Dependency injection
Dependency injection is a way to supply a new instance of a class with the fully-formed dependencies it requires.
Most dependencies are services. Angular uses dependency injection to provide new components with the services
they need.
Angular can tell which services a component needs by looking at the types of its constructor parameters.
References:
1. https://angular.io/
2. https://angular.io/tutorial
3. https://www.w3schools.com/angular/angular_intro.asp
4. https://www.tutorialspoint.com/angularjs/index.htm
5. https://www.javatpoint.com/angularjs-tutorial
Oral Questions:
1. What is data binding in AngularJS?
2. What is scope in AngularJS?
3. What are the controllers in AngularJS?
4. What are the services in AngularJS?
5. What are the filters in AngularJS?
6. Explain directives in AngularJS.
7. Explain templates in AngularJS.
8. What is routing in AngularJS?
9. What is deep linking in AngularJS?
10. What are the advantages of AngularJS?
11. What are the disadvantages of AngularJS?
12. Which are the core directives of AngularJS?
13. Explain AngularJS boot process.
14. What is MVC?
15. Explain ng-app directive.
16. Explain ng-model directive.
17. Explain ng-bind directive.
18. Explain ng-controller directive.
19. How AngularJS integrates with HTML?
20. Explain ng-init directive.
21. Explain ng-repeat directive.
22. What are AngularJS expressions?
23. Explain uppercase filter.
24. Explain lowercase filter.
25. Explain currency filter.
26. Explain filter filter.
27. Explain orderby filter.
28. Explain ng-disabled directive.
29. Explain ng-show directive.
30. Explain ng-hide directive.
31. Explain ng-click directive.
32. How angular.module works?
33. How to validate data in AngularJS?
34. Explain ng-include directive.
35. How to make an ajax call using Angular JS?
36. What is use of $routeProvider in AngularJS?
37. What is $rootScope?
38. What is scope hierarchy in AngularJS?
39. What is a service?
40. What is service method?
41. What is factory method?
42. What are the differences between service and factory methods?
43. Which components can be injected as a dependency in AngularJS?
44. What is provider?
45. What is constant?
46. Is AngularJS extensible?
47. On which types of component can we create a custom directive?
48. What is internationalization? How to implement internationalization in AngularJS?
Assignment No. 8
Design, develop and deploy web application using EJB, JSP & Servlet from the
PROBLEM given list :
STATEMEN 1. Online pizza order application
T 2. Student information system for training & placement department
/DEFINITION 3. Leave management application
4. Blogging platform
5. Meeting room booking application
6. Exam cell automation application
● To understand working of EJB
OBJECTIVE ● To explore the usage of EJB with JSP and Servlet
S/W Operating System open source Fedora 20 Networked computer with internet
PACKAGE access
S AND Editor : IDE : Netbeans 8.1
HARDWARE Web browser Mozilla Firefox, Google Chrome
APPARATU
S USED
● http://www.ejbtutorial.com/category/ejb
REFERENCES ● https://www.javatpoint.com/ejb-tutorial
● https://netbeans.org/kb/docs/javaee/entappclient.html
● https://examples.javacodegeeks.com/enterprise-java/ejb3/ejb-tutorial-
beginners-example/
● https://netbeans.org/kb/docs/javaee/javaee-entapp-ejb.html
● https://wowjava.wordpress.com/2011/01/14/a-simple-ejb-3-0-example-
with- jsp-and-servlet/
● https://www.youtube.com/watch?v=uI8TGqv-5hk&feature=related
● http://www.pavanjaiswal.com/2018/03/simple-ejb-jsp-
servlet- application.html
INSTRUCTIONS ● Title
FOR ● Problem Statement
WRITING ● Theory
JOURNAL ● Architecture diagrams ( design part )
● Troubleshooting ( if any )
● Conclusion
● References
EJB
EJB (Enterprise Java Bean) is used to develop scalable, robust and secured enterprise applications in java.
Unlike RMI, middleware services such as security, transaction management etc. are provided by EJB Container
to all EJB applications.
The current version of EJB is EJB 3.2. The development of EJB 3 is faster than EJB 2 because of simplicity and
annotations such as @EJB, @Stateless, @Stateful, @ModelDriven, @PreDestroy, @PostConstruct etc.
To run EJB application, you need an application server (EJB Container) such as Jboss, Glassfish, Weblogic,
Websphere etc. It performs:
EJB application is deployed on the server, so it is called server side component also.
EJB is like COM (Component Object Model) provided by Microsoft. But, it is different from Java Bean, RMI and
Web Services.
Types of EJB?
There are 3 types of enterprise bean in java.
Session Bean: Session bean contains business logic that can be invoked by local, remote or webservice client.
Message Driven Bean: Like Session Bean, it contains the business logic but it is invoked by passing message.
Entity Bean: It encapsulates the state that can be persisted in the database. It is deprecated. Now, it is replaced
with JPA (Java Persistent API).
RMI EJB
In RMI, middleware services such as security, In EJB, middleware services are provided by EJB
transaction management, object pooling etc. need Container automatically.
to be done by the java programmer.
RMI is not a server-side component. It is not EJB is a server-side component, it is required to be
required to be deployed on the server. deployed on the server.
RMI is built on the top of socket programming. EJB technology is built on the top of RMI.
EJB and Webservice
In EJB, bean component and bean client both must be written in java language.
If bean client need to be written in other language such as .net, php etc, we need to go with webservices (SOAP
or REST). So EJB with web service will be better option.
Disadvantages of EJB
1. Requires application server
2. Requires only java client. For other language client, you need to go for webservice.
3. Complex to understand and develop ejb applications
Session Bean
Session bean encapsulates business logic only, it can be invoked by local, remote and webservice client.
The life cycle of session bean is maintained by the application server (EJB Container).
In other words, conversational state between multiple method calls is not maintained by the container in case of
stateless session bean.
The stateless bean objects are pooled by the EJB container to service the request on demand.
It can be accessed by one client at a time. In case of concurrent access, EJB container routes each request to
different instance.
1. @Stateless
2. @PostConstruct
3. @PreDestroy
22. In EJBExample application create index.jsp which will have form to accept your name and
submit event to: use_ejb.do servlet url-pattern
23. Contents of index.jsp
24. Contents of processRequest() method of UseBean servlet which in turns calling SessionBean
method showName()
25. Right click to EJBExample – properties – library – add
projects MyEJB and EJBRemoteInterface
27. Deploy MyEJB. Just right click on it and select option Deploy
28. If everything goes fine, then run your project EJBExample. You will see index.jsp ready to accept
your name in browser.
Congratulations!!! You are done with your First EJB-JSP-Servlet application.
References:
1. http://www.ejbtutorial.com/category/ejb
2. https://www.javatpoint.com/ejb-tutorial
3. https://netbeans.org/kb/docs/javaee/entappclient.html
4. https://examples.javacodegeeks.com/enterprise-java/ejb3/ejb-tutorial-beginners-example/
5. https://netbeans.org/kb/docs/javaee/javaee-entapp-ejb.html
6. https://wowjava.wordpress.com/2011/01/14/a-simple-ejb-3-0-example-with-jsp-and-servlet/
7. https://www.youtube.com/watch?v=uI8TGqv-5hk&feature=related
8. http://www.pavanjaiswal.com/2018/03/simple-ejb-jsp-servlet-application.html
Oral questions:
1. What is EJB?
2. What are the types of Enterprise Beans
3. What is session bean?
4. What is stateless session bean?
5. What is stateful session bean?
6. What is entity bean?
7. What are the benefits of EJB?
8. When to use local session bean and remote session bean?
9. Is Message Driven bean a stateless bean?
10. Explain @ annotations used in beans.
Assignment 11:
Title
Roll No and Name of Student
Batch
Abstract
Tech Stack(Front end and Back end Technologies used)
Description of Modules:
Use cases
Class diagrams
Testing
Results and UI