ASSIGNMENT 1
(Includes Questions from Unit 1, 2 & 3)
Questions on CSS (Unit 1):
1. What do web designers mean when they talk about a style?
A style is simply a set of formatting instructions that can be applied to a piece of text.
Styles can be cascaded. This means that formats override any which were defined or included earlier in the document.
For instance, we may include an external stylesheet which redefines the h1 tag, then write an h1 style in the head section of the page before finally redefining h1 in the body of the page. The browser will use the last of these definitions when showing the content.
2. Describe the different ways that styles can be added to a page.
There are three mechanisms by which we can apply styles to a HTML document:
- The style can be defined within the basic HTML tag using style attribute. This method of defining a style within the html tag itself is called inline style.
- Styles can be define in the <head> section of an html file and applied to the whole document. This type of defining styles is called internal style.
- Styles can also be defined in external files (with the extension .css) called stylesheets which can then be used in any document by including the stylesheet via a URI.
3. What are the benefits of using styles compared with placing formatting directly into the element of a web page?
The syntax of the style definition changes when it is done inside an HTML tag. The definition becomes an attribute, named style, of the tag. The description of the style is passed as the value of the attribute and so must follow an equal sign. The definition is placed inside quotation marks. Defining the style inside the html tag is called inline style.
Defining the style using <style> tag in the header section allows the style to be defined separately from the content of the web page. Internal styles are defined in the same html file for which the styles are defined. Compared to the inline styles, internal styles can define styles for a group or class of html elements.
Defining the style in a separate file with the extension .css, separates the styles from the content of the web page to which they are applied. External stylesheets define styles that can be applied to a collection of web pages belonging to a web site. Through external style sheets uniformity can be maintained in applying styles to more than one web page.
4. What is a stylesheet class? Illustrate with an example.
5. HTML has two commands which are used to apply formatting to elements which are placed within them. What are they? Compare and contrast the use of them in a web page.
Questions on JavaScript (Unit 2):
6. Create a web page which uses prompt() dialog to ask a user for their name, age and shoe size. Display the information they enter on the page formatted as a small table.
Questions on Servlet (Unit 3):
7. When a Servlet receives a request from a client, it has access to two objects for managing the request. What are they? Explain them with example.
8. Describe the life cycle of a Servlet. Also write a simple Servlet that reads three parameters from the form data.
ASSIGNMENT 2
(Include Questions from Unit 3, 4 & 5)
Questions on Servlets (Unit 3)
1. List the differences between GenericServlet and HttpServlet.
2. What are the advantages of Servlets over CGI Scripting.
3. Explain in detail how HTTP Post request can be handled from a servler, using an example.
Questions on JSP (Unit 4)
4 . Mention the techniques that are available for sharing user data among JSP pages. Explain any two of them with sample code.
5. Explain Anatomy of a JSP Page.
6. What are Java Beans? How do you make use of them in a JSP Page?
Bean means component. Components mean reusable objects. JavaBean is a reusable component. Java Bean is a normal java class that may declare properties, setter, and getter methods in order to represent a particular user form on the server-side.
Java Bean is useful to combine multiple simple values to an object and to send that object from one resource to another resource or one layer to another layer. For example, to keep form data into a single object we can use java bean. Java Bean is a specially constructed Java class written in Java and coded according to the Java Beans API specification.
Working of JavaBeans in JSP
First, the browser sends the request for the JSP page. Then the JSP page accesses Java Bean and invokes the business logic. After invoking the business logic Java Bean connects to the database and gets/saves the data. At last, the response is sent to the browser which is generated by the JSP.

Accessing JavaBeans in JSP Application?
<jsp:useBean>
The jsp:useBean tag is utilized to start up an object of JavaBean or it can re-utilize the existing java bean object. The primary motivation behind jsp:useBean tag is to interface with bean objects from a specific JSP page. In this tag, it is consistently suggestible to give either application or meeting degree to the extension characteristic worth.
At the point when the compartment experiences this label then the holder will get class characteristic worth for example completely qualified name of Bean class then the holder will perceive Bean .class record and perform Bean class stacking and launch. Subsequent to making the Bean object compartment will allot Bean object reference to the variable indicated as an incentive to id property. In the wake of getting Bean object reference holder will store Bean object in an extension indicated as an incentive to scope trait.
Syntax: <jsp:useBean id=”—” class”—” type”—” scope=”—”/>
Questions on PHP (Unit 5)
7. Discuss about various functions used in PHP with examples.
8. Define operator. Explain different operators used in PHP.
9. Write a PHP Program to find the factorial of a given Number.