[go: up one dir, main page]

0% found this document useful (0 votes)
51 views8 pages

Web Technologies Exam Guide for TE Students

The document is an exam paper for the Web Technologies course for T.E. Computer Engineering at Pune Vidyarthi Griha's College of Engineering, Nashik. It includes various questions on web development topics such as design issues, browser requests, XML technology, differences between HTML and HTML5, jQuery advantages, JavaScript data types, JSP implicit objects, servlets, and thread safety in JSP. The document also provides model answers for the questions, covering essential concepts and examples.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views8 pages

Web Technologies Exam Guide for TE Students

The document is an exam paper for the Web Technologies course for T.E. Computer Engineering at Pune Vidyarthi Griha's College of Engineering, Nashik. It includes various questions on web development topics such as design issues, browser requests, XML technology, differences between HTML and HTML5, jQuery advantages, JavaScript data types, JSP implicit objects, servlets, and thread safety in JSP. The document also provides model answers for the questions, covering essential concepts and examples.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Web Technologies TE Computer Engineering

Total Nos. of Questions 6] Roll No.

Pune Vidyarthi Griha’s


COLLEGE OF ENGINEERING, NASHIK – 4.
T.E. (Computer Engineering)
WEB TECHNOLOGIES (2015 Pattern)
IN-SEM EXAM MARCH-2019
Time : 1 Hour [Max. Marks : 30]
Instructions to the candidates:
1) Solve Que. 1 or 2, Que.3 or 4, Que. 5 or 6.
2) Neat diagrams must be drawn wherever necessary.
3) Assume suitable data if necessary.
4) Figures to the right indicate full marks.

WT MODEL ANSWER INSEM MARCH – 2019

Q1 a) List & Discuss different design issues in Web Development?[5M]


Ans

Browser Compatibility:- The web page should be properly displayed on different browsers like chrome,
Firefox , IE and mobile compatible browser like safari and opera Mini. Hence while building website, the
web pages should be checked on all possible browsers and os, with old and latest versions.

Screen Resolution:- Usually common resolution of screen is 1024*768 pixels, but now there is growing
trend towards higher resolution. If the website is designed for higher resolution, it may be possible that
some low resolution screens may not be able to display contents.

Internet Speed:- Near about 50% of web users expect that the web page should be loaded in 2 sec oe
even less. Use of more images or heavy media like animations or video slow down the downloading
process of web pages.

Scalability:- Scalability is another issue which a developer need to keeps in mind while developing.
Scalability is the process of balancing the loads between the servers. scalability factor comes into play
when the traffic of a page of website suddenly increases. so the developer should design the website in a
way that additional servers can be added if needed.

Security:- Security is a factor which cannot be neglected at any cost because data breach can be very
harmful for any online business or any personal website. Developers need to consider about many things
when it comes to security like denial of service attacks, safety of users data like name and contact
information, database malfunctioning. unauthorized access, and other security threats like phishing, ,shell
injection and cross site scripting.

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu
Web Technologies TE Computer Engineering

Q1b) Describe the steps involved when a web browser requests for and obtains a web page from a
web server.[5M]

1. You type an URL into address bar in your preferred browser.


2. To reach the host, it first needs to translate the human readable host into an IP number, and it
does this by doing a DNS lookup on the host
3. Then a socket needs to be opened from the user’s computer to that IP number, on the port
specified (most often port 80)
4. When a connection is open, the HTTP request is sent to the host
5. The host forwards the request to the server software (most often Apache) configured to listen on
the specified port
6. The server inspects the request (most often only the path), and launches the server plugin
needed to handle the request (corresponding to the server language you use, PHP, Java, .NET,
Python?)
7. The plugin gets access to the full request, and starts to prepare a HTTP response.
8. To construct the response a database is (most likely) accessed. A database search is made, based
on parameters in the path (or data) of the request
9. Data from the database, together with other information the plugin decides to add, is combined
into a long string of text (probably HTML).
10. The plugin combines that data with some meta data (in the form of HTTP headers), and sends the
HTTP response back to the browser.
11. The browser receives the response, and parses the HTML (which with 95% probability is broken)
in the response
12. A DOM tree is built out of the broken HTML
13. New requests are made to the server for each new resource that is found in the HTML source
(typically images, style sheets, and JavaScript files). Go back to step 3 and repeat for each resource.
14. Stylesheets are parsed, and the rendering information in each gets attached to the matching node
in the DOM tree
15. Javascript is parsed and executed, and DOM nodes are moved and style information is updated
accordingly
16. The browser renders the page on the screen according to the DOM tree and the style information
for each node
17. You see the page on the screen
18. You get annoyed the whole process was too slow.

Q2a) What are the strengths of XML technology? Explain the need of XML.[5]

Advantages of XML include the following:

 XML uses human, not computer, language. XML is readable and understandable, even by novices,
and no more difficult to code than HTML.
 XML is completely compatible with Java™ and 100% portable. Any application that can process
XML can use your information, regardless of platform.
 XML is extendable. Create your own tags, or use tags created by others, that use the natural
language of your domain, that have the attributes you need, and that makes sense to you and your
users.’

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu
Web Technologies TE Computer Engineering

XML is widely used in the era of web development. It is also used to simplify data storage and data
sharing
1) XML separates data from HTML
2) XML simplifies data sharing
3) XML simplifies data transport

Q2b) Write and explain ant 5 differences between HTML and HTMl5. [5M]

Html Html5

Doctype declaration in Html is too longer


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML DOCTYPE declaration in Html5 is very simple
4.01//EN" "[Link] /TR /html4 "<!DOCTYPE html>
/[Link]">

character encoding in Html is also longer


character encoding (charset) declaration is also
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
very simple <meta charset="UTF-8">
4.0 Transitional//EN">

Audio and Videos are integral part of HTML5


Audio and Video are not part of HTML4
e.g. <audio> and <video> tags.

Html5 use cookies. It provides local storage in place of cookies.

Not possible to draw shapes like circle, rectangle, Using Html5 you can draw shapes like circle,
triangle. rectangle, triangle.

Does not allow JavaScript to run in browser. JS Allows JavaScript to run in background. This is
runs in same thread as browser interface. possible due to JS Web worker API in HTML5

Works with all old browsers Supported by all new browser.

Q3a)When to use JQuery? What are the advantages of using JQuery over java script.[5M]

jQuery is a JavaScript library, so it operates on top of JavaScript. It cannot exist on its own, so you can't use
one over the other. You can use just JavaScript or JavaScript and jQuery. jQuery was introduced to make
development with JavaScript easier. It will reduce the development time. Use it to add animation and even
handling on your website.

jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid
web development. jQuery is easier to use compared to JavaScript and its other JavaScript libraries. You
need to write fewer lines of code while using jQuery, in comparison with JavaScript.
]

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu
Web Technologies TE Computer Engineering

Advantages of using JQuery over java script

 The amount of code you need to write is vastly smaller


 It handles cross browser differences for you
 Easy DOM manipulation
 It presents a single events API
 Effects such as fading, sliding and more
 It makes Ajax much much MUCH simpler

Q3b)What are different data types available in Java Script? Explain correct syntax of declaration of
it.[5M]

Two Kinds of Data Types

In JavaScript there are two different kinds of data: primitives, and objects. A primitive is simply a data
type that is not an object, and has no methods.

In JS, there are six primitive data types:

 Boolean
 Number
 String
 Null
 Undefined
 Symbol

Boolean

A boolean represents only one of two values: true, or false. Think of a boolean as an on/off or a yes/no
switch.

var boo1 = true;


var boo2 =
false;Number

There is only one type of Number in JavaScript. Numbers can be written with or without a decimal point. A
number can also be +Infinity, -Infinity, and NaN (not a number).

var num1 = 32;


var num2 = +Infinity;

String

Strings are used for storing text. Strings must be inside of either double or single quotes. In JS, Strings are
immutable (they cannot be changed).

var str1 = 'hello, it is me';


var str2 = "hello, it's me";

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu
Web Technologies TE Computer Engineering

Null

Null has one value: null. It is explicitly nothing.

var nothing = null;

Undefined

A variable that has no value is undefined.

var testVar;
[Link](testVar); // undefined

Symbol

Symbols are new in ES6. A Symbol is an immutable primitive value that is unique. For the sake of brevity,
that is the extent that this article will cover Symbols.

const mySymbol = Symbol('mySymbol');

Objects

Objects are not a primitive data Type.

An object is a collection of properties. These properties are stored in key/value pairs. Properties can
reference any type of data, including objects and/or primitive values.

var obj = {
key1: 'value',
key2: 'value',
key3: true,
key4: 32,
key5: {}
}

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu
Web Technologies TE Computer Engineering

Q4a)How to create array in Java Script? Brief reading of array in Java Script[5M]

Using an array literal is the easiest way to create a JavaScript Array.

Syntax: var array_name = [item1, item2, ...];

Example
var cars = ["Saab", "Volvo", "BMW"];

Access the Elements of an Array

You access an array element by referring to the index number.

This statement accesses the value of the first element in cars:

var name = cars[0];

Example
var cars = ["Saab", "Volvo", "BMW"];
[Link]("demo").innerHTML = cars[0];

Looping Array Elements

The safest way to loop through an array, is using a for loop:

Example
var fruits, text, fLen, i;
fruits = ["Banana", "Orange", "Apple", "Mango"];
fLen = [Link];

for (i = 0; i < fLen; i++) {


fruits[i]; }

Q5a)List and elaborate any 5 implicit JSP object.[5M]

Implicit Objects in JSP. These Objects are the Java objects that the JSP Container makes available to the
developers in each page and the developer can call them directly without being explicitly declared. JSP
Implicit Objects are also called pre-defined variables.

Following table lists out the nine Implicit Objects that JSP supports −

[Link]. Object & Description


1 request
This is the HttpServletRequest object associated with the request.
2 response
This is the HttpServletResponse object associated with the response to the client.
3 out
This is the PrintWriter object used to send output to the client.
4 session

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu
Web Technologies TE Computer Engineering

This is the HttpSession object associated with the request.


5 application
This is the ServletContext object associated with the application context.
6 config
This is the ServletConfig object associated with the page.

Q5b)Write a Java Servlet Program which will display “Welcome to Servlet” Message.[5M]
import [Link].*;
import [Link].*;
import [Link].*;
public class SimpleServlet extends GenericServlet
{
public void service (ServletRequest request, ServletResponse response) throws IOException,
ServletException
{
[Link]("text/html");
PrintWriter out = [Link]();
[Link]("<b>Welcome to Servlet</b>");
[Link]();
}
}

Q6a)What is use of isThreadSafe in JSP? Also explain single thread model in JSP. [5M]

isThreadSafe:

 It defines the threading model for the generated servlet.


 It indicates the level of thread safety implemented in the page.
 Its default value is true so simultaneous
 We can use this attribute to implement SingleThreadModel interface in generated servlet.
 If we set it to false, then it will implement SingleThreadModel and can access any shared objects
and can yield inconsistency.

Syntax of isThreadSafe:

<% @ page isThreadSafe="true/false" %>

Here true or false represents if synchronization is there then set as true and set it as false.

Example:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"


isThreadSafe="true"%>

How do you implement Single Thread Model in JSP?


By simply include a page directives
<%@page isThreadSafe=”false” %>

The JSP programmer can implement SingleThreadModel interface to ensure that it can handle only one
request at a time.

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu
Web Technologies TE Computer Engineering

Q6b)Write a servlet which will accept username and password in a form , which will compare both
in a code to display success or failure.[5M]

[Link]

<html>
<body>
<h2>Login Page</h2>
<p>Please enter your username and password</p>
<form method="GET" action="loginServlet">
Username <input type="text" name="userName" size="50">
Password <input type="text" name="password" size="20">
<input type="submit" value="Submit" name="B1">
</form>
</body>
</html>

[Link]

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class LoginServlet extends HttpServlet {


public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
[Link]("text/html");
PrintWriter out = [Link]();
String un = [Link]("userName");
String pw = [Link]("password");
if (un == ‘admin’ && pw == ‘admin’)
[Link]("Success");
else
[Link]("Failure");

}
}

Pune Vidyarthi Griha’s College Of Engineering, Nasik Prepared By : Prof. Anand Gharu

You might also like