IT-205 Web Engineering Solution-1 hdjdbbdhdbdhhsbsh hsbsh shbshs hs sehbhssjusnsjsnsu PDF

Title IT-205 Web Engineering Solution-1 hdjdbbdhdbdhhsbsh hsbsh shbshs hs sehbhssjusnsjsnsu
Author Anmol Khan
Course IT Project
Institution University of the Punjab
Pages 22
File Size 544 KB
File Type PDF
Total Downloads 9
Total Views 136

Summary

Gsysbsy hsbsysbhsbshs shehyshshsbhshsbhs shshsubshsbsh zhshshhs hsbsusnhhs dhakpaoamsjbdhs hsnlaisnalaihsmaks akosjsnakajebakowjnakjsusbnsjwnkslaosn jsksj. J's uzs hz Usbsuwn.zjnssnsus sbushsbsn gshbsbsbs.sjsnhe,shsysb,hshahNusnsjubbhvwbhsjhsjwlospwwiutvzhauBjaalosuanoahznsihznQkzhh she hs she h shw...


Description

Subject IT-205 Web Engineering Engineering So Solution lution Of shor short t Quest Question ion (2012 to 2018 2018))

Solve b by y Waseem Ali Roll No 025442

om

Note: Some short question answers as a long question because these question repeat as long question

fo .b lo gs po ts

.c

Solution Of 2012 Question#2:

1. What is difference between static website and dynamic website?

s

o

r

A static website is one which does not make use of any external database and is written completely in HTML. This means that every user who visits that website will receive the exact same information. Additionally, making updates to static websites means going directly into the HTML and making the changes from there.

:

A dynamic website on the other hand, can generate content based on the user. Think of Facebook as an example, when you login, you are greeted by a page of updates tailored to you based on your likes, friends, etc. This page of content is specific to you as a user and will update dynamically as time goes on. Dynamic websites offer a lot of benefits owing to the dynamic content, interactive features and multimedia elements making content management easy and efficiently which ultimately reduces the maintenance cost on the long haul plus it is open to changes and future add-ons which only add to the benefits. Well, static websites are quick to develop because they are the basic types without the extra Page :1

bells and whistles. Flexibility is where the static websites excel because each page is created different which makes it easy for the web designer to experiment on different pages to make them unique. Dynamic sites are always stylish and sophisticated and are more interactive in nature 2. Differentiate between HTML and XML? XML is the acronym from Extensible Markup Language (metalanguage of noting/marking). XML is a resembling language with HTML. It was developed for describing data.  The XML tags are not pre-defined in XML. You will have to create tags according to your needs.  XML is self-descriptive.  XML uses DDT principle (Defining the Document Type) to formally describe the data.  The main difference between XML and HTML: XML is not a substitute for HTML.  XML was developed to describe data and to focalize on what the data represent.  HTML was developed to display data about to focalize on the way that data looks.  HTML is about displaying data, XML is about describing information.  XML is extensible. 3. What is difference between servlet and java server pages?

l in

k



1) The first and foremost difference between Servlet and JSP is that a JSP is a web page scripting language that can generate dynamic content while Servlets are Java programs that are already compiled which also creates dynamic web content. 2) The second difference between Servlet vs JSP is that JSP is actually translated and compiled into Servlet by web container when the first request comes for it, on the other hand, Servlet is already a Java program, whose instance is created and managed by the web container. Page :2

k: bs pr og ra

i

o

l

g

p

t

c

m

3) Since JSP is translated and compiled into Servlet, they run faster compared to JSP. 4) JSP was designed for HTML developer who doesn't know Java but familiar with the tag-based markup language like HTML, while Servlet is designed for Java developers who like to code in Java. 5) In MVC design pattern, JSP (Java Server Pages) act as a view and servlet act as a Controller. 6) JSP are generally preferred when there is not much processing of data required. But Servlets are best for use when there are more processing and manipulation involved. Your JSP should be as dumb as possible i.e. it should not contain any logic, all logic should go to Servlets. The job of JSP should just to display the data provided via model to it. If your JSP starts containing logic then it would be difficult to maintain. 7)The advantage of JSP programming over Servlet is that we can build custom tags which can directly call Java beans. There is no such facility in servlets. On the other JSTL is the popular tag library which allows you to completely remove Java from JSP

Solution Of 2013

ln

Question # 02 1. How can you create a comment in HTML? This element is used to add a comment to an HTML document. An HTML comment begins with . HTML comments are visible to anyone that views the page source code, but are not rendered when the HTML document is rendered by a browser.

2. What do you mean by internal CSS? Internal or Embedded CSS: This can be used when a single HTML document must be styled uniquely. The CSS rule set should be within the HTML file in the head section i.e the Page :3

.c

fo .b lo gs po ts



Internal CSS



GeeksForGeeks A computer science portal for geeks



om

CSS is embedded within the HTML file. Example:

in

.

pr og ra m

3. Differentiate between static website and dynamic website?

Static v Dynamic Website Design There are basically two main types of website - static and dynamic. A static site is one that is usually written in plain HTML and what is in the code of the page is what is displayed to the user. A dynamic site is one that is written using a server-side scripting language such as PHP, ASP, JSP, or ColdFusion. In such a site the content is called in by the scripting language from other files or from a database depending on actions taken by the user.

Relative merits of static and dynamic websites

Page :4

Static sites - advantages Flexibility is the main advantage of a static site - every page can be different if desired, to match the layout to different content, and the designer is free to put in any special effects that a client may ask for in a unique way on different pages. This allows theming - for instance an author may want a different theme for a different book and associated pages or perhaps for a series of books, in order to match the cover designs or the context of the stories. Cost is generally lower up-front than a dynamic site.

Static sites - disadvantages The main problem with any static site appears when you wish to update the content. Unless you are conversant with HTML and the design methods used in the site then you have to go back to the designer to have any content changes made. This may be perfectly ok when a new page is required which needs design input, but if all you want to do is change some text then it can be a nuisance for both client and designer. The second main problem is scalability. If you wish to sell products on your site and you have a lot of them then you may have to construct individual pages for each one, which can take considerable time, effort and cost. Costs - there are ongoing costs for updating the content.

Dynamic sites - advantages The main advantages of dynamic sites are that by connecting them to databases you can easily pull in information in an organised and structured way to create product pages or categories of related products sorted in a variety of different ways depending on how the user wants to view them. This ability to connect to a database means that you can also create a content management system - an interface which allows the client to input and manage data via a web-based series of administration pages. That content can be text for their pages and images to go along with the text, or items in their product range with categories, specifications, short and long descriptions, images, etc. In both these cases it can be as simple or as complex as the client requires. There are little or no ongoing costs unless there is a change in the basic design or an extra capability added. Page :5

Dynamic sites - disadvantages The design of a dynamic site is more fixed than a static one because many of the pages are essentially a template into which data and content is poured to create multiple pages of a similar type. So for instance all your product pages will be essentially the same page layout with different data being displayed. While some customization capability can be built in it is usually quite limited, such a selecting from a set of pre-defined options. Individual layout changes to particular pages are not usually possible.

og sp ot s

.c

o

Costs are higher initially than for a static site, and additional functionality may also cost more, particularly if it's something that wasn't envisaged originally and requires re-writing of the core code or database.

4. Differentiate between stateless and state-full protocols? 1). Stateful protocol means the server remembers what a client has done before.

k: bs pr og ra m

in

f

1).When stateless protocol is used between a server and the client, the server does not remember anything. It treats any message from a client as the client's first message and responds with the same effects every time

l in

2). A stateless server does not keeps state between connections. =>So,Whenyou send a request to a stateless server, it does not create any objects that track information regarding your requests. If you "open" something on the server, the server retains no information at all that you have something open. A "close" operation would make no sense, since there would be nothing to close.

2). .A stateful server keeps state between connections. =>when you send a request to a stateful server, it may create some kind of connection object that tracks what information you request. When you send another request, that request operates on the state from the previous request. So you can send a request to "open" something. And then you can send a request to "close" it later. In-between the two requests, that thing is "open" on the server.

Page :6

3). A stateless system can be seen 3). a statefulsystem is like a state as a box ,where at any point in machine with "memory" as the same set of input(s)value can time the value of the output(s) generate different depends only on the value of the output(s)depending on the input(s)after a certain processing previous input(s)received by the time. system.

fo .b lo gs po ts

.c

om

4). A stateless protocol does not 4). a protocol which requires the require the server to retain session keeping of internal state is known information or status about each communications partner for the duration of multiple requests.

og ra m

in

5. Differentiate between 2-tier and 3-tier web architecture? (Repeat as long question) 6. What protocol(s) is used to access webpages?(Repeat as long question) 7. What do you mean by query string, what kind of data can be sent in it? A query string is the portion of a URL where data is passed to a web application and/or back-end database. The reason we need query strings is that the HTTP protocol is stateless by design. For a website to be anything more than a brochure, you need to maintain state (store data). There are a number of ways to do this: On most web servers, you can use something like session state server-side. On the client, you can store via cookies. Or in the URL, you can store data via a query string. 8. For what purpose session variables are used? Session variables are special variables that exist only while the user's session with your application is active. Session variables are specific to each visitor to your site. They are used to store user-specific

Page :7

information that needs to be accessed by multiple pages in a web application.

om

In browser applications, each request for a page is completely independent of earlier requests. If you want subsequent pages to remember things like a user id that was entered on the sign-on page, you can store it in a session variable to be retrieved later. The concept of session variables is similar to the LDA in traditional RPG development. Once the user has logged off, all session variables are gone.

fo .b lo gs po ts

.c

Session variables are commonly used to store information such as user preferences and privileges. Another advantage of using session variables is that the values are not shown in the query string. For this reason, session variables are commonly used to store sensitive information such as the current user id and password.

k: bs pr og ra m

in

When the session ends, either from the user closing the browser or due to a time-out, the session variables are cleared.

9. Differentiate between servlet and java server pages?

Difference between Servlet and JSP

l in

Brief Introduction: A servlet is a Java class which is used to extend the capabilities of servers that host applications accessed by means of a request-response model. Servlets are mainly used to extend the applications hosted by webs servers, however, they can respond to other types of requests too. For such applications, HTTP-specific servlet classes are defined by Java Servlet technology. A JSP is a text document which contains two types of text: static data and dynamic data. The static data can be expressed in any text-based format (like HTML, XML, SVG and WML), and the dynamic content can be expressed by JSP elements.

Difference between Servlet and JSP SERVLET

JSP

Page :8

Servlet is a java code.

JSP is a html based code.

Writing code for servlet is harder than JSP as it is html in java.

JSP is easy to code as it is java in html.

JSP is the view in MVC approach for showing output.

om

Servlet plays a controller role in MVC approach.

JSP is slower than Servlet because the first step in

Servlet is faster than JSP.

fo .b lo gs po ts

.c

JSP lifecycle is the translation of JSP to java code and then compile.

Servlet can accept all protocol requests.

JSP only accept http requests.

In JSP, we cannot override its service() method.

k: bs pr og ra m

in

In Servlet, we can override the service() method.

In Servlet by default session management is not

In JSP session management is automatically

enabled, user have to enable it explicitly.

enabled.

l in

In Servlet we have to implement everything like business logic and presentation logic in just one

In JSP business logic is separated from

servlet file.

presentation logic by using javaBeans.

Modification in Servlet is a time consuming task because it includes reloading, recompiling and

JSP modification is fast, just need to click the

restarting the server.

refresh button.

10.How do you out a message in the browser’s status bar using JavaScript? Page :9

JavaScript gives you the ability to modify the status bar. For example it can be useful to display information about a link, when the user moves his mouse over it or you can display a small amount of information about the page the user is on in the status bar. You can also trick people into clicking a link, so be careful how you use it. If you play too many tricks on your visitors, they might not come back. Status Bar Example:

JavaScript Status Bar

HTMLcenter

Solution Of 2014 1. How can you add a page title in HTML?

Page :10

Every web page needs a title. Why doesn't yours? One of the major tag pairs in HTML is the tags; the title tag affects several functions of websites, from the default bookmark titles through to flashing words drawing your attention back to the site, even when in a different tab.

of

.c the

document......

in

content

k: bs pr og ra m

The

fo .b lo gs po ts

HTMLReference

om



2. What do you mean by external CSS?

l in

An external style sheet is a separate file where you can declare all the styles that you want to use on your website. You then link to the external style sheet from all your HTML pages. This means you only need to set the styles for each element once. If you want to update the style of your website, you only need to do it in one place

3. What is the purpose of interactive website? An interactive web design is a design for websites which uses other inbuilt software, modules or features aimed at creating an Page :11

environment for a website or web application user to be actively engaged during visit or use as the case may be, thereby improving his or her user experience (UX). Kelvin is a young high school student. While he awaited his test results and subsequent admission to college, he thought he could get a job and make some money. As a result, he would have to submit a curriculum vitae (CV) to a job site to be considered. This is not something he could easily do on his own without help so he searched on the Internet for a solution and came across an online job site - Lynt Job Portal.

 

Find Jobs Find Resumes Employers/Post Jobs

bl o



ts

.c

Lynt Job Portal had the following options to select from:

Kelvin selected the 'Find Jobs' and two search fields was displayed, namely 'What Type of Job (preferred company name, keywords is required)' and 'Where (preferred location)'. He entered the details and a number of job listings to select from, based on his preference, were displayed. On clicking the 'apply' button for the preferred job, he was required to submit his CV either through uploading an already created one or filling out a new one. Since he didn't have one, he went on to fill out a new one. Several fields were displayed for Kelvin to enter responses which would form the basis of his new CV. Kelvin entered the details and submitted the entries after reading through to confirm its correctness. What Kelvin had just experienced on Lynt Job Portal is what an Interactive website is all about. Benefits of Interactive Web Design Benefits of an interactive web design include:

Page :12













o. b



It allows visitors and users to customize their user experiences through the submission of personal choice data. It enables the website owner to expand their reach more than they would have been able to without any form of interactivity with the visitors through the use of Social Media and blogs. It guides users and visitors on the site to their desired location of information. It saves time and money as it enables visitors or users access to information even when the company's live chat or emails are not manned at certain times of the day. It enhances and compliments business functions of companies, schools and other institutions through user-friendly help content management. User experience feedback are easily be captured. Customer and client retention are highest on websites that use some forms of interactive web designs. Cases of unfinished transactions are also in the barest minimum.

k: bs pr og ra

Kelvin found the job site of beneficial value to him as he was able to draft a CV for himself following the ...


Similar Free PDFs