ORAL Co-Ordination
ORAL Co-Ordination
ORAL Co-Ordination
Servlets are the Java programs that runs on the Java-enabled web server or application
server. They are used to handle the request obtained from the web server, process the
request, produce the response, then send response back to the web server.
JavaServer Pages (JSP) is a Java standard technology that enables you to write dynamic,
data-driven pages for your Java web applications. JSP is built on top of the Java Servlet
specification.
A scriptlet tag is used to execute java source code in JSP. Syntax is as follows:
<% java source code %>
In this JSP tags are used to insert JAVA code into HTML pages. ( scriptlet Tag)
It stands for Java Server Pages.
It is a server side technology.
It is used for creating web application.
It is used to create dynamic web content.
It is an advanced version of Servlet Technology.
It is a Web based technology helps us to create dynamic and platform independent web
pages.
In this, Java code can be inserted in HTML/ XML pages or both.
JSP is first converted into servlet by JSP container before processing the client’s request.
They are easy to maintain.
No recompilation or redeployment is required.
JSP has access to entire API of JAVA .
JSP are extended version of Servlet.
AngularJS Directives
The AngularJS framework can be divided into three major parts −
<div ng-app="">
<p>Name: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
</div>
Bootstrap is a free front-end framework for faster and easier web development
Bootstrap includes HTML and CSS based design templates for typography, forms, buttons,
tables, navigation, modals, image carousels and many other, as well as optional JavaScript
plugins
Bootstrap also gives you the ability to easily create responsive designs
WordPress is a Content Management System (CMS), which is open source and was created
to manage blogs. WordPress allows you to easily create and manage your blogs and
websites content without coding and it can be used to create a fully operational website.
A content management system, often abbreviated as CMS, is software that helps users
create, manage, and modify content on a website without the need for specialized technical
knowledge.
A CDN (Content Delivery Network) is a highly-distributed platform of servers that helps
minimize delays in loading web page content by reducing the physical distance between the
server and the user. This helps users around the world view the same high-quality content
without slow loading times.
Questions -
canvas tag
The <canvas> tag in HTML is used to draw graphics on a web page using
JavaScript. It can be used to draw paths, boxes, texts, gradients, and adding
images. By default, it does not contain borders and text.
<canvas id = "geeks" height = "200" width = "200"
style = "border:1px solid black">
</canvas>
sections tags
Section tag defines the section of documents such as chapters, headers, footers or
any other sections. The section tag divides the content into section and
subsections. The section tag is used when requirements of two headers or footers
or any other section of documents needed.
<section>
<h2>WWF's Symbol</h2>
</section>
executeUpdate
Instead of returning a collection of rows, the executeUpdate() method returns the number of
rows affected by the SQL command it executes.
executeUpdate() method returns the number of rows affected by the SQL command it
executes.
String query = "delete from user where firstname=?";
PreparedStatement pst1 = conn.prepareStatement(query);
pst1.setString(1,fname);
int ii = pst1.executeUpdate();
Iframe tag
The <iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML
document.<iframe src="https://www.w3schools.com" title="W3Schools
Free Online Web Tutorials"></iframe>
Frameset Tag
<jsp:include>
Eg
<title>JSP include Directive example</title>
<%@ include file="display.jsp" %>
if(mysqli_connect_errno())
{
echo "Connection Error <br>";
}
else
{
echo "<br>Connection establish <br>";
}
doget() vs dopost()
->doGet() shall be used when small amount of data and insensitive data like a query
has to be sent as a request. ->doPost() shall be used when comparatively large
amount of sensitive data has to be sent.
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
doGet();
} else {
doPost();
}
alt in <image>
The required alt attribute specifies an alternate text for an image, if the
image cannot be displayed.
The alt attribute provides alternative information for an image if a user for
some reason cannot view it (because of slow connection, an error in the src
attribute, or if the user uses a screen reader).
javascript vs jquery
JQuery has an inbuilt feature of cross-browser compatibility.
JQuery is concise and one need not write much as scripting already exists.
In JQuery, we can add animation effects easily with fewer lines of code.
While JQuery is a library, derived from JavaScript hence, it is lightweight.
Class in CSS
The .class selector selects elements with a specific class attribute.To select
elements with a specific class, write a period (.) character, followed by the
name of the class.
effects in jquerry
With jQuery, you can create custom animations.
The jQuery animate() method is used to create custom animations.
copy the code into your your JSP directory under /usr/local/etc/httpd/htdocs/html/LOGIN
(where LOGIN is your login name). You will need to change the 'xxxxxx' of
"con=DriverManager.getConnection("jdbc:mysql://localhost/"+db,user,"xxxxxxx");" to reflect
your MySQL password. Copy the HTML form (right click and view source) to the same
directory above or to your public_html directory and use it connect to your database via the
JSP code. Replace the 'test418' with your database name and the URL with your JSP URL.
<body>
<h1>JDBC Connection example</h1>
<%
String db = request.getParameter("db");
String user = db; // assumes database name is the same as username
try {
java.sql.Connection con;
Class.forName("org.gjt.mm.mysql.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/"+db, user, "xxxxxxx");
out.println (db+ "database successfully opened.");
}
catch(SQLException e) {
out.println("SQLException caught: " +e.getMessage());
}
%>
</body>
</html>
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url,username,pass);
out.println("\nConnection Successful!!..");
Statement st = con.createStatement();
● $_POST
● $_GET
Httpservlet vs genericservlet
-> GenericServlet is a super class of HttpServlet class. -> The main difference is
that, HttpServlet is a protocol dependent whereas GenericServlet is protocol
independent. So GenericServlet can handle all types of protocols, but HttpServlet
handle only HTTP specific protocols.
Global variables refer to any variable that is defined outside of the function. Global
variables can be accessed from any part of the script i.e. inside and outside of the
function.
Associative arrays are arrays that use named keys that you assign to them.
or:
$age['Peter'] = "35";
$age['Ben'] = "37";
$age['Joe'] = "43";
1. Page directive
2. Include directive
3. Taglib directive
ResultSet rs = stmt.executeQuery(query);
A ResultSet object is a table of data representing a database result set, which is usually generated by
executing a statement that queries the database. For example, the CoffeeTables.viewTable method
creates a ResultSet, rs, when it executes the query through the Statement object, stmt. Note that a
ResultSet object can be created through any object that implements the Statement interface, including
PreparedStatement, CallableStatement, and RowSet.
● $_GLOBALS
● $_SERVER
● $_REQUEST
● $_POST
● $_GET
● $_FILES
● $_ENV
● $_COOKIE
● $_SESSION
init method
The ng-init directive is used to initialize an AngularJS Application data. It
defines the initial value for an AngularJS application and assigns values to the
variables.
The ng-init directive defines initial values and variables for an AngularJS
application.
The Document Object Model (DOM) is a programming interface for HTML and XML
documents. It represents the page so that programs can change the document
structure, style, and content. The DOM represents the document as nodes and
objects. That way, programming languages can connect to the page.
defination list
The <dl> tag is used in conjunction with <dt> (defines terms/names) and
<dd> (describes each term/name).
Css selectors
In CSS, selectors are patterns used to select the element(s) you want to
style.
Html vs html5
HTML is referred to as the primary language of the World Wide Web. HTML has
many updates over time, and the latest HTML version is HTML5. There are some
differences between the two versions:
● HTML5 supports both audio and video while none of them were part of
● HTML cannot allow JavaScript to run within the web browser, while HTML5
provides full support for running JavaScript.
● In HTML5, inline mathML and SVG can be used in a text, while in HTML it is
not possible.
● HTML5 supports new types of form controls, such as date and time, email,
number, category, title, Url, search, etc.
● Many elements have been introduced in HTML5. Some of the most important
are time, audio, description, embed, fig, shape, footer, article, canvas, navy,
output, section, source, track, video, etc.
$("p").toggle(
function(){$("p").css({"color": "red"});},
function(){$("p").css({"color": "blue"});},
function(){$("p").css({"color": "green"});
});
The toggle() method attaches two or more functions to toggle between for
the click event for the selected elements.
When clicking on an element, the first specified function fires, when clicking
again, the second function fires, and so on.
When present, it specifies that an input field must be filled out before
submitting the form.
what is dom
When a web page is loaded, the browser creates a Document Object Model of
the page.
commnet in html
<!-- -->
This function returns true if the value equates to NaN. Otherwise it returns
false.
undefnied vs Null
null is a special value meaning "no value". null is a special object because typeof null
returns 'object'.
On the other hand, undefined means that the variable has not been declared, or has not
been given a value.
pattern attribute
<input type="text" id="country_code" name="country_code"
pattern="[A-Za-z]{3}" title="Three letter country code"><br><br>
What is json
JSON is often used when data is sent from a server to a web page
{"firstName":"John", "lastName":"Doe"}
Elements in json
JSON defines seven value types: string, number, object, array, true, false, and null.
The following example shows JSON data for a sample object that contains name-value pairs.
Data is stored in a set of key-value pairs.This data is human readable, which makes JSON perfect for
manual editing
We will look at four jQuery methods that are used to add new content:
The second approach you can use to register a driver, is to use the static
DriverManager.registerDriver() method.
1 XML is used for storing data in a XSLT is used for transforming and also
structured format. for formatting XML file to display the
content or to process the content.
2 XML does not perform XSLT is a specialized language that
transformation of data. performs transformation of one XML
document into a different XML document.
XSLT can also perform transformation of
XML document into HTML document and
XHTML document.
3 XPath is a specialized language that XSLT will be using XPath for
is used to address portions of the transformation and formatting of XML file.
XML file.
"Cascading" in this context means that because more than one stylesheet declaration
could apply to a particular piece of HTML, there has to be a known way of determining
which specific stylesheet rule applies to which piece of HTML.
The rule used is chosen by cascading down from the more general declarations to the
specific rule required. The most specific declaration is chosen.
Before the Flexbox Layout module, there were four layout modes:
The Flexible Box Layout Module, makes it easier to design flexible responsive
layout structure without using float or positioning.