IP-IA 2 Answer Key

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

KGISL INSTITUTE OF TECHNOLOGY,

Doc. Ref.
COIMBATORE -35, TN, INDIA
EXAMINATIONS - FORMS
Issue No / Date
ANSWER KEY
ACADEMIC YEAR: 2022 - 2023 Department CSE

IA1 - ANSWER KEY


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CLASS: : III CSE MAX MARKS : 50
SEMESTER: : VI DURATION : 1Hr 30Min
COURSE TITLE : INTERNET PROGRAMMING COURSECODE : CS8651
COURSE NO : C310 DATE& SESSION : 27.04.2023 FN
ACADEMIC YEAR : 2021-2022 EXAM : IA-2

ANSWER ALL QUESTIONS


Write the applications of servlets.
 Read the explicit data sent by the clients (browsers). ...
 Read the implicit HTTP request data sent by the clients (browsers). ...
1.
 Process the data and generate the results. ...
 Send the explicit data (i.e., the document) to the clients (browsers). ...
 Send the implicit HTTP response to the clients (browsers).
Describe the need to use JSTL tags.
A tag library defines a collection of custom actions. The tags can be used directly by developers in
2.
manually coding a JSP page, or automatically by Java development tools. A tag library must be portable
between different JSP container implementations.
List the rules for creating variables in PHP.
 A variable starts with the $ sign, followed by the name of the variable.
3.  A variable name must start with a letter or the underscore character.
 A variable name cannot start with a number.
 A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Define PHP.
PHP is a recursive acronym for "PHP: Hypertext Preprocessor". PHP is a server side scripting language
4.
that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build
entire e-commerce sites.
State type conversion in PHP?
5. Datatype conversion is the process of changing the type of the variable from one datatype to another.
PHP provides various datatypes and the type conversion can be performed in various methods.

6(a).Demonstrate Servlet Architecture & Life Cycle of Servlet with a neat diagram.

(or)
KGISL INSTITUTE OF TECHNOLOGY,
Doc. Ref.
COIMBATORE -35, TN, INDIA
EXAMINATIONS - FORMS
Issue No / Date
ANSWER KEY
ACADEMIC YEAR: 2022 - 2023 Department CSE

6(b).Demonstrate the steps involved in Database connectivity with different types of JDBC drivers.
Steps For Connectivity Between Java Program and Database
 Import the Packages
 Load the drivers using the forName() method
 Register the drivers using DriverManager
 Establish a connection using the Connection class object
 Create a statement
 Execute the query
 Close the connections
steps in brief before implementing by writing suitable code to illustrate connectivity steps for JDBC
Step 1: Import the Packages
Step 2: Loading the drivers
2-A Class.forName()
2-B DriverManager.registerDriver()
Step 3: Establish a connection using the Connection class object
Step 4: Create a statement
Step 5: Execute the query
7(a). Use regular expression for string comparison capability in PHP with an example.
preg_match() tester function for the above example.

<?php
$my_url = "www.guru99.com";
if (preg_match("/guru/", $my_url))
{
echo "the url $my_url contains guru";
}
else
{
echo "the url $my_url does not contain guru";
}
?>
PHP Preg_split()
<?php
$my_text="I Love Regular Expressions";
$my_array = preg_split("/ /", $my_text);
print_r($my_array );
?>
PHP Preg_replace()
<?php
$text = "We at Guru99 strive to make quality education affordable to the masses. Guru99.com";
$text = preg_replace("/Guru/", '<span style="background:yellow">Guru</span>', $text);
echo $text;
?>
(Or)
KGISL INSTITUTE OF TECHNOLOGY,
Doc. Ref.
COIMBATORE -35, TN, INDIA
EXAMINATIONS - FORMS
Issue No / Date
ANSWER KEY
ACADEMIC YEAR: 2022 - 2023 Department CSE

7(b).Determine the uses of


1. RSS
Advantages for Subscribers
 All news at one place
 News when you want it
 Get the news you
 Freedom from e-mail overload
 Easy republishing
Advantages for Publishers
 Easier publishing
 A simpler writing process
 An improved relationship with your subscribers
 The assurance of reaching your subscribers
 Links back to your site
 Relevance and timeliness
2. ATOM
The blogging community uses web feeds to share recent entries' headlines, full text, and even
attached multimedia files.[2] The providers allow other websites to incorporate a blog's "syndicated" headline
or headline-and-short-summary feeds under various usage agreements. As of 2016 people use Atom and
other web-syndication formats for many purposes, including journalism, marketing, bug-reports, or any other
activity involving periodic updates or publications. Atom also provides a standard way to export an entire
blog, or parts of it, for backup or for importing into other blogging systems.
It is common to find web feeds on major websites, as well as on many smaller ones. [citation needed] Some
websites let people choose between RSS- or Atom-formatted web feeds; others offer only RSS or only
Atom. In particular, many blog and wiki sites offer their web feeds in the Atom format.A feed reader or
"aggregator" program can be used to check feeds and to display new articles.
Client-side readers may also be designed as standalone programs or as extensions to existing
programs like web browsers. Web-based feed readers and news aggregators require no software installation
and make the user's "feeds" available on any computer with web access. Some aggregators syndicate
(combine) web feeds into new feeds, e.g., taking all football-related items from several sports feeds and
providing a new football feed.
PART – C (1X 8 = 8 Marks)
ANSWER ALL QUESTIONS
8(a).Use the session handling techniques in a dynamic web page with a neat diagram.
Session Tracking is a way to maintain state (data) of an user. It is also known as session
management in servlet.Http protocol is a stateless so we need to maintain state using session tracking
techniques. Each time user requests to the server, server treats the request as the new request. So we need to
maintain the state of an user to recognize to particular user.
KGISL INSTITUTE OF TECHNOLOGY,
Doc. Ref.
COIMBATORE -35, TN, INDIA
EXAMINATIONS - FORMS
Issue No / Date
ANSWER KEY
ACADEMIC YEAR: 2022 - 2023 Department CSE

(or)
8(b).Determine the uses of Java Server Pages Standard Tags Library.
1<fmt:formatNumber> To render numerical value with specific precision or format.
2<fmt:parseNumber>Parses the string representation of a number, currency, or percentage.
3<fmt:formatDate>Formats a date and/or time using the supplied styles and pattern
4<fmt:parseDate> Parses the string representation of a date and/or time
5<fmt:bundle>Loads a resource bundle to be used by its tag body
6<fmt:setLocale>Stores the given locale in the locale configuration variable.
7<fmt:setBundle>Loads a resource bundle and stores it in the named scoped variable or the bundle
configuration variable.
8<fmt:timeZone>Specifies the time zone for any time formatting or parsing actions nested in its body.
9<fmt:setTimeZone>Stores the given time zone in the time zone configuration variable
10<fmt:message>Displays an internationalized message.
11<fmt:requestEncoding>Sets the request character encoding

Prepared By Approved by

Faculty HOD

You might also like