You are on page 1of 21

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)

NAME ROLL NO. LEARNING CENTER CODE DATE OF SUBMISSION

: : : :

Kunal Mhatre 581111279

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)

1) Give one example each for the following and explain the use in one/two tine each.
1. Web Design Tools Design for the Web is one of the most significant areas that are emerging in the development of websites. Web design refers to the task of developing a Web page or the user interface of the Web page. The design of a Web page acts as a medium between people and information. The major intention of Web design is in the development of attractive Web pages that reside on Web servers. Web design tools concentrates more on the presentation of contents using hypertext, images, videos, and so on. There are various tools available today that help us develop and design Web pages. We can term these as design tools. Design tools help us to design attractive Web pages easily and quickly. Some of the popular Web design tools are as follows HTML Editors. Adobe Photoshop. Adobe Flash. Firebug Browser 2. HTML Editors HTML editor refers to a software application that we can use to create Webpages. It provides us with various tools that are required to design a Website. Even though the HTML files can be written using any text editor such as notepad or text pad, specialized HTML editors can provide convenience and additional functionalities. It not only offers support to work with HTML tags but also provides support to work with technologies such as Cascading Style Sheets (CSS), Extensible Mark-up Language (XML) and JavaScript. They even help us to handle the interactions that happen with remote Web server through the File Transfer Protocol (FTP)and Web-based Distributed Authoring and Versioning (WebDAV). HTML Editor is useful as wended not have to type or remember all the HTML tags. We can say that it is just like the word processor where we type the content and apply the required formats. We can see the HTML source as well as view how the Webpage would look like when viewed on the Web browser, by switching to the display format. 3. Adobe Photoshop Adobe Photoshop is a software application package useful in editing images and is considered as an important tool for Web designing. It is an excellent tool to create attractive Websites. Photoshop can read and write raster and vector image formats. For example ,gif, jpeg and .png. An image in raster format is described in a table of pixels, where each pixel has a specific color. Adobe Photoshop is considered as an image editing tool for Web design as it useful in the following ways: 1. It helps you to tune your art work to the design of your a Web page on your Website. 2. It can be used to add graphics to your videos that you might have uploaded on your Website. 3. It helps to create different types of web banners and buttons that would enhance the look of your Website. 4. It also helps us to turn an image or photograph look like a work of art, that is, to look like a painting.

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
5. It can be used to create a rollover effect to the images or button on your Web pages easily without writing any code by just adding different behaviors to different images or buttons. Here, by rollover effect we mean that we can make a particular area of an image to change when you click or move the mouse over an image 4. Adobe Flash Adobe Flash is a multimedia graphics program that is used to create interactive Web pages, videos and animations. It can be embedded inside any HTML program to create interactive Web pages. Other than being used for creating interactive Web pages it is also widely used in games and advertisements. Adobe Flash helps you to create interactive videos on the Web. It uses vector graphics. Here, vector graphics refers to graphics that can be scaled to any size of our choice without any loss inequality or clarity. We need not have any kind of programming knowledge to use this software as it is very easy to learn. It captures user input through keyboard, mouse, microphone and camera. We will now look into some of the uses of Adobe Flash. Some of the uses of Adobe Flash areas follow: 1. It helps us to load Flash movies at a faster pace when compared to animated GIF's. This is because animated GIF's includes numerous images saved in one image. Thus when a Web browser loads such an image, the browser may need to load all the frames of the image before display. Therefore, it takes longer time for a GIF image to load. 2. It helps to create simple animations and buttons quickly and easily. 3. It supports interactivity. Thus, it helps us to control animations using Flash software. For example, we can begin animating an image after the user clicks on a button. 4. It is possible to embed the animations created using Flash into a Web page. 5. It is mostly used in the creation of vector based animations and helps in reducing the file sizes. Reduction in the file size helps to quickly download and play movies on the Webpages. 5. Firebug Browser Firebug is also an excellent Web development tool, which is an add-on for Mozilla Firefox. It provides us with various tools to inspect, edit, and debug Web pages. This add-on provides us a tabbed interface that facilitates us to edit as well as debug HTML, CSS and JavaScript codes in any Web page. It also offers DOM (Document Object Model) inspection and appraisal related to the performance of Websites. Some of the uses of Firebug Browser are as follows: 1. It is very easy to learn the tool as it is user friendly. It also provides you the facility to open the Firebug window within your Web browser, as you saw in Figure 10.1, or as separate window. 2. It lets us examine and edit the HTML tags. Whenever there is any change in the HTML code the Firebug highlights the modifications made in yellow. 3. It even lets you make modifications to the code and see the output of the change instantly

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)

2) Write a Java program to demonstrate the use of control statements (all three statements) in Java.
We know that a program is a collection of statements that are carried out to accomplish a task which was decided in advance. And, in a program, normally the statements are executed in sequential order, which is called sequential execution or sequential control flow. Thus, you can define Control statements as the statements which are used for controlling the execution flow in a program. In Java, we can classify the control statements into three categories namely, looping statements, conditional statements, and special control statements, as depicted in the figure below:

JAVA
Loop --For Loop --While Loop --Do-while loop Java Control Statements 1. Looping statements: Looping statements are those statements, which enables you to execute group of statements frequently. They are also called as iteration statements. You will notice that the JAVA programming language has three types of looping statements/constructs, namely, for, while, and do-while. Let us briefly describe them. For loop: For loop is the most flexible looping statement, used for the continuous execution of a piece of code until a specific condition is satisfied. We use the following syntax of for loop. For (initialization; condition; increment or decrement) { Statement1; Statement1; } While loop: While loop is a looping statement which frequently executes a block of statements as long as a condition remains true, look at the syntax of while loop. Initialization; Conditional --If Statement --If Else Statement --Switch Statement Special control --Continue Statement --Return Statement

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
While (condition) { Statement1 Statement1 } Do-while loop: Do-while loop is a looping statement, which is used like while loop (which frequently executes a block of statements as long as a condition remains true). The difference between the do-while and while loops is that, in the do-while loop, the statements within the loop are guaranteed to be executed at least once regardless of the condition evaluation, do-while loop below: Initialization Do { Statement1 Statement1 } While (condition) In do-while loop, you have to initialize the control variable before the loop. Then, the statements are executed. After the statements are executed, the given condition in the while statement is tested. If the result of this test is true, again the statements within the body of the loop are executed. These steps are followed as long as the condition is true. When the condition becomes false, the loop terminates and the control goes to the statement immediately after the while statement 2. Conditional statements: Java supports three conditional statements, that is, if, if-else, switch. If statement: If is a conditional statement, which gives permission to a program, for executing various blocks of code, depending on the evaluation of a test. The syntax of if statement is as follows If condition { Statement1;

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
Statement2; } If the given condition is true, the statements within the parentheses (statement1, statement 2) are executed; otherwise, the statements are skipped and the statements after the loop are executed. If-else statement: If-else is also a conditional statement, which is an addition to the if statement. The general form of the if-else statement is: If condition { Statement1; } Else { Statement1; } Switch statement: Switch statement is also a conditional statement, which is like else-if statement with several else statements whose conditions are tested in sequential order. Let us have a look at the syntax of switch statement Switch (expression) { Case value 1: Statement 1 Break; Case value 2: Statement 2 Break Default;

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
Statement n Break } In the above syntax, firstly the value of a given variable (expression) is tested against a list of case values. If the program finds a match, the statements associated with that case are executed. If no match is found, the statement in the default block is executed. 3. Special control statements: Break statement Break is a special control statement which is used for getting out from a loop before its (loops) completion, on a pre-defined condition, or you can say that it ends the loop that immediately surrounds it. We can use this statement with while loop, do-while loop, for loop, and switch statement. Continue statement: Continue is also a special control statement, which is used to stop the control flowing the program and return the control to the loop without the execution of the statements which are written after the continue statement; and which tells the system to jump out from the remaining part of the current loop. This statement is useful when we want to execute just some of the statements in a loop. The continue statement will skip the remainder of the loop statements and evaluate the condition of the loop as before. Return statement: Return is the last special control statement, which is used for finally returning from a method, that is, it tells the Java interpreter to stop the execution of the current method. If you want your method declaration to return a value, you have to write an expression after the return statement; and that expressions value will become the desired return value. You must have noticed that in some programs, some methods are declared void; it means that they do not return any value

3) What are the difference types of inheritance in Java? Explain the relationship between interfaces and inheritances.
We can define inheritance as the process of inheriting features of one object by another. If we use inheritance, we can easily manage the information about the objects. A super class and its subclasses have an in-a relationship. We can define such relationship using Java inheritance. It means that you can use an object of a subclass (sometimes it is called as child class), wherever you can use an object of the super class (sometimes it is called as parent class). In Java, we use class inheritance for creating or building new classes from existing classes. You can analyze the same from the figure Inheritance in Java Inheritance types in Java: Simple inheritance: It refers to the process of deriving/inheriting a child class simply from its parent class. You must note that there is only one child class and its parent class, in this kind of inheritance. You can

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
also call it as single inheritance or one level inheritance. Example of a parent class vehicle, and a child class bus; which is shown in figure

Vehicle ====> Bus


Figure: Example of Simple Inheritance

Multilevel inheritance: It refers to the process of deriving a child class from another child class. Here, note that the inherited class is known as child class for its parent class and this child class act as the parent class for its child class. There may be many levels in multilevel inheritance. For example, a parent

Vehicle ==> Bus ==> A/C Bus


Figure: Example of Simple Inheritance

Hierarchical inheritance: This type of inheritance is used for assisting the hierarchical program design. In this type of inheritance, many features of one level (one parent class) can be inherited by many others (child classes) below that level. Let us analyze this by looking at the example in the figure

The relationship between interfaces and inheritances: In Java, we can achieve multiple inheritances with the help of interfaces. We can do so by exercising one or more than one interface within a class, which results in the creation of classes which are built upon other classes. These classes will not be constrained by the problems created by multiple inheritances. The main problem with multiple inheritances is that it is difficult to resolve a method that is inherited from more than one parent. We can define an interface as a logical collection of methods. Any class implementing an interface must define such methods. Note that such interfaces can also define constants (public static final). Only abstract methods and final fields are defined in interfaces, not the code for implementing these methods. In interfaces, data fields only comprise of constants. Look at some similarities between an interface and a class:

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
Both an interface and a class can have any number of methods. We write an interface and a class in a file which has a .java extension, with the same name as the filename. Nevertheless, an interface and a class are different in several ways, such as: Interface cannot be instantiated, but a class can be .An interface does not have any constructor, but a class can have a constructor. All the methods of an interface are abstract while a class may or may not have abstract methods. We cannot extend an interface by a class; but can implement it by a class. One major difference is that a class explains the properties and behaviors of an object, but an interface explains behaviors which will be implemented by a class. We will now see how to define interfaces, extend interfaces, implementing interfaces

4) Give an example for cascade style sheets and explain editing with cascade style sheets in detail
Web Page Editing with CSS In the previous section, we studied about the benefits of CSS and also the methods by which you can apply CSS to HTML documents. In this section we will learn some simple techniques to format your HTML document using CSS. Now, before discussing about the text formatting let us discuss how you can create styles in a style sheet and incorporate it in the HTML document. This is achieved using the CSS class selector. So, what is this CSS class selector? The class selector is used to specify a style for a group of HTML elements (refer to Unit 2 for HTML elements). Using this you can specify a particular style for any HTML element. Below is an example that helps you understand how to use the class selector.

This example uses internal method to apply style to the HTML document (refer section 4.2 for internal method). All the CSS class selectors will start with a ".", followed by the name of the class selector. In our example, the name given to the class selector is ".center" (refer previous section for syntax of CSS tag). The "text-align" attribute is used for aligning the text, in our example, we are passing the value "center" to the attribute "text-align" i.e. the text for which the

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
style is applied will be aligned at the center of the Web page. Now we have created a class selector named "center" to align the text at the center of the Web page. "<h1 class="center">Center-aligned heading</h1>" this line shows how you can call the class defined in the <head> element to apply style. Note, you can choose any name you like for the class. In this case, we have chosen to call the class as center, since it is being used to center text. As you can see in the code line we are calling the class "center" using the attribute "class" inside the opening tag <h1>. Similarly, in the above code we are calling the class "center" inside the opening tag <p>. Once you call the class, the style will be applied to the content that you define using the HTML element. We have called the class "center" in the header element and the content that is present in the <h1> element will be aligned at the center of the Web page. Similarly, the content within the <p> and </p> tags will be aligned at the center of the Web page. You follow the same method of class usage in the style sheet that is defined in a separate file. First, you define the class in the style sheet and then link the style sheet to the HTML document (refer to section 4.2.2) and use the class selector as explained above. You can also restrict the class to a particular HTML tag. Say for example, you want to create a class only for the paragraph tag <p>, and the style defined by a class will not be applicable to any other tags. Let us modify the previous code example for better understanding.

We have taken a part of the code from the previous code example and modified it. As you can see in the above code instead of "." we have used "p." before the class selector "center". This means that the class is restricted only to <p> tag and you cannot use it to apply style to other tags. For example, "<p class="center">Centre-aligned paragraph.</p>" code line is correct and the text with in the tags will be aligned at the center. However, "<h1 class="center">Centrealigned heading</h1>" code line is incorrect. Even though you define the class, the style will not be applied to the text inside the <h1> tag. Formatting the text We have learnt to create CSS class and also how to use them for apply styles in the HTML document. Let us now learn how to format text on an HTML document using the class. Text indention: This is used to align the text from the margin of the Web page. This is done as shown below:

The above code line is a class that we have defined to apply an indentation of 30 pixel form the margin. The "text-indent" is a CSS attribute to which we pass the appropriate indentation value.

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
Text alignment: We can align the text using the CSS attribute similar to the HTML attributes that we studied in Unit 2. For example:

In the above code line we have defined a p-class with the class name "align text". The "textalign" is the CSS attribute used to align the text on the Web page and "center" is the value that we pass the attribute. This attribute aligns the text to the center of the Web page. The text can be aligned to the right or justified (refer Unit 2 for example of right alignment). When you pass the value justify" to the attribute, each text line on the Web page will be stretched so that both the right and left margins are straight. This is similar to the style that you see in this book, were every line in a paragraph is of same length. Text decoration: This property is used to add effects such as underline, over-line or linethrough the Web page text. You can define a class as shown below to achieve text decoration,

In the above example code, the "decoration" is the name given to the class and "textdecoration" it is the attribute used to decorate the text on the Web page. We are passing the value "underline" which underlines the text on the Web page. We can pass other values such as: Over-line: The value helps you to draw a line over the text on the Web page. Line-through: This value helps you to draw a line through the text on the Web page. Letter space: This allows you to fix the spacing between the text characters. You can specify it with the help of the attribute "letter-spacing" and by passing the desired value of the space in the form of pixel you can adjust the spacing between the text characters. The example code line for obtaining a character spacing of three pixels is given below:

Text transformation: The text transformation property helps you to control the capitalization of the text on the Web page. You can make the text all upper caps, lower caps or capitalize the first character of every word in the given text. This is achieved by using the attribute "texttransform". The code line for text transformation is as shown below:

In the above code line, the "transform" is the CSS class selector name and "text-transform" is the attribute to which we pass the value "uppercase" to convert the text to uppercase. For example, "sachin" will be transformed to "SACHIN". For converting the text to lower case, you can pass the value "lowercase" to the attribute. When you pass the value "capitalize", the first letter of each word in the text will appear in capital for example, "garden city of India" will be "Garden City of India".

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)

Margins: Page, whether it is a page in your text book or the Web page, will have margins. This is the portion of the page acts as the border for the page and within this border you can insert the content. Figure 4.1 show a Web page along with its margin widths.

Figure 4.1: Web Page with Margins


As you can see from the figure the top margin is 100 pixels from the top end of the page, left margin is 70 pixels from left end of the page, right margin is 40 pixel from right end of the page and bottom margin is 10 pixels from bottom end of the page. Let us now write the code line to fix the page using the CSS for the margins as shown in figure 4.1.

This code enables you to create the page that you see in figure 4.1. The "fix margin" is the name of the class selector used to define the class containing the page margins. The attribute "margin-top" is used to adjust the top margin, "margin-bottom" is used to adjust the bottom margin, "margin-left" is used to adjust the left margin, and "margin-right" is used to adjust the right margin of the page. (Fixing the margin is similar to selecting the page margin in Microsofts Word documents.) Using colors with CSS

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
In the previous sub-section, we learnt the basic techniques of formatting the text on a HTML document using CSS. Let us now learn how to apply colors to the text and background of the Web page. Color property: The color property of the CSS enables you to change the color of the text displayed on the Web page. Say for example, you want to create a class to change the color of the text to red then you can write the code as shown below:

In the above code you can see that the attribute "color" is used to pass the color value, in our example we are passing the value "red". When you use the class "recolor" in a text element, the text within the tags will be displayed in red color. You can provide various other values such as blue, green and so on. Background color: This property enables you to choose the background color of the Web page. With the help of the attribute "background-color", you can change the background color of the Web page. One more important point to remember is that you can choose independent background color for each element. For example, you can have a green background for the paragraph text, a blue background for the heading text and grey color for the other portion of the Web page. This can be done as follows:

Now, the entire body of the Web page will appear with a grey background, content within the <h1> element will appear with a blue background and content within the <p> element will appear with a green background. Positioning elements with CSS In the previous sub section we learnt about the color property of CSS. Let us now learn about the positioning elements of HTML with CSS. With the help of positioning property of CSS, you a place an HTML element wherever you want it on the Web page. The principle behind this is very simple, the entire Web page is divided into number of pixels, by providing the appropriate pixel position you can position the content of the HTML element such as paragraph or heading on the Web page. You can position the elements using the four different properties top, bottom, left and right. Let us now learn the two important positioning types, they are:

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
Absolute positioning. Relative positioning. Absolute positioning: With this type of positioning you can place your content anywhere on the Web page. The example code for absolute positioning is as shown below:

As you can see from the above code the attribute "position" is used to define the positioning type. In the "left" attribute, we define the distance between the first character of the content of the paragraph element and the left end of the Web page. In the "top" attribute, we define the distance between the first line of the content of the paragraph element and the top of the Web page. Note, if we have multiple paragraph elements in a page, the text of an earlier paragraph will be replaced by the text of a paragraph later in the Web page, since all paragraphs start at the same position in the Web page. The value passed to these attributes is in the form of pixels. Relative positioning: The relative positioning is similar to absolute positioning. The difference between the absolute and relative positioning is that in absolute positioning, no other elements can over lap on the space that it defined for absolute positioning. For example, consider the previous absolute positioning code, where the content starts 100 pixels form the left end of the page. No other element can occupy the space next to the

element with absolute positioning. However, using relative positioning you can place elements next to each other. The example below clearly explains how this is done:

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)

In the above code you can see that the value for the attribute "top" is same i.e.150 pixels. The h1 is placed, 350 pixels away from the left end of the page, the h2 is placed, 150 pixels away from the left end of the page and h3 is placed, 50 pixels away from the left end of the page. For example, consider three header elements <h1> Header 1 </h1>, <h2> Header 2 </h2>, <h3> Header 2 </h3> and display them on the Web page. The top half of the figure 4.2 shows the header elements without the use of relative positioning. The bottom half shows the same header elements with the use of the relative positioning. Notice, the header elements in the bottom half are positioned relative to their normal positioning in the top half without CSS.

5) Describe the working of search engine. What are the different types of search engine? Explain with its application.
Working of a Search Engine You have now learnt the meaning and origin of a search engine. Let us now study about the working of a search engine. How do we search for a Web page using any search engine? We open the search engine Website for example, www.google.com or www.bing.com and then in the text box provided we type the keywords of our choice and press enter key or click the search button. This process will provide us a list of Websites based on the keyword entered. Do you think the working of a search engine so simple? The answer is No. The working of search engines is not this simple. It involves incredibly detailed processes and methodologies. There might be some differences in the working of different search engines. However, all of them perform three fundamental tasks includingcrawling the Web by following all possible links from any Web page, extracting keywords from the collected Web pages and building an index, and allowing users to search for matching Web pages using the keywords saved in the index.

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
Search engines today are indexing and responding to billions of Web pages in a single day. Let us now look at how all these happen. Search engines use the following processes in its working: Web Crawling. Indexing. Searching. We will now study each of these operations in detail. Web crawling: When you search for information by typing keywords in a search engine Website it gives you a list of related information. Prior to listing the related information, it has to find it. In order to retrieve information from the numerous Websites that exist on the WWW, a search engine utilizes special software robots known as spiders. The spiders are simple programs that scan the Web pages to create a list or index of words that are found on the Websites, and the process of creating a list or index of words by a spider is known as Web crawling. Spiders: are also known as bots, web robots or automatic indexers. The spider program has to scroll through many Web pages in order to create and maintain a list of useful words. A search engine uses a spider program to gather information that is available on Web pages. The information needs to be gathered so that the search engines can provide us the relevant Websites when we search for a particular term. Indexing: After the spider program finishes the job of looking for information on the Web pages, the search engines have to store the information such that it is useful for the users. This is known as indexing. An efficient indexing helps us to quickly find information on the Web. We have to note that the data needs to be encoded and then stored in a more compact form in order to save the storage space. The information is ready for indexing once it is compacted. The two key components responsible for indexing or making the gathered data accessible to users are as follows: The information that is stored with the data: Here, a search engine can store the word and the Uniform Resource Locator (URL) of the Web page where the word was found. However, this result in limited use of the Web page as it will not inform the user if the word was used many times or only once. It will also not specify if the page comprises links to any other page, or if the word was an important phrase on the Web page. Therefore, we can say that we will not be able to put the most important page on top of the list from the search results. The technique in which the information is indexed: Here, a search engine stores the number of times the word has appeared on the Web page rather than storing only the word and the URL. A particular words value increases when it appears in the heading, sub heading or in the links.

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
Considering this, a search engine assigns weight to every entry. Every search engine follows different formulas to allot weight to words in its index. Therefore, we can observe that, different lists are produced by different search engines when we search for a particular word. Most of the search engines today are following this technique. Searching: It refers to the process of querying a search engine. A query should have at least a minimum of one word. You can also have complex queries. Complex queries are built using Boolean operators that help us to refine the search. For example, OR, AND, and NOT are known as Boolean operators. Table 9.1 illustrates the use each of these Boolean operators. Table 9.1: Boolean Operators and Its Uses

Figure 9.1 depicts the working of a search engine.

Figure 9.1: Working of a Search Engine As you can observe in figure 9.1 a spider program starts the process of indexing on Websites that are listed on frequently used servers and on popular Web pages. It indexes the words and

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
links present within a Website. Like this the spider program moves through various areas of the WWW that are widely used and creates index of words and compresses the same to save the storage space. Then the compressed data is stored so that the users can access the data by querying the search engine. Types of search engine Now that you have learnt how a search engine works, let us now study the different types of search engines. The different types of search engines are: Crawler based search engines. Human powered directories. Hybrid or mixed search engines. We will now study more about these search engines. Crawler based search engines: In this type of search engines the spiders crawl through the Web and create a listing or index of words. Whenever a user enters a query or a keyword using a search engine, the word is searched for against these listings or index. The index consists of a copy of all the Web pages that is found by the spider. Whenever a change is made to any of the Web pages, the spider will update the changes in the index. This is possible as the spiders are always crawling through the Web pages on a regular basis. This also affects the way your Website is listed. We should also note that it takes some time when the spiders crawl through the Web pages and an index is created. Until then the Web page will not be found when you search for it using a search engine. Google and Yahoo use a crawler based search engines. Human powered directories: In this type of search engine there is a directory which gets information from short descriptions about the websites along with the address and title of the Web pages that are submitted by the webmasters. These submissions are later reviewed by the editors. The disadvantage of human powered directories is that it can take months to get your Website reviewed unless you take up a paid inclusion program. We should also note that when a user searches for a topic these directories look for only the descriptions that are submitted on the Website and not the entire content of the Web page. As such any change made to the Website does not affect its listing. The only advantage of this type of a search engine is that a Website which comprises good content could be reviewed for free when compared to a poor site. Earlier Yahoo! was a human powered directory. However, today it uses a crawler based search engine. Hybrid or mixed search engine: It is a combination or mixture of crawler based search engines and human powered directories. The basic idea behind a hybrid search engine is to provide the users with a combination of results including spidered results and directory results. Google and Yahoo are today using hybrid search engines. Google calls this Universal Search. The advantage of this type of a search engine is that the multiple types of results complement each other, and ultimately offer the users with more complete and relevant search results. This is depicted in figure 9.2.

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)

Figure 9.2: Result of Search on a Hybrid or Mixed Search Engine In figure 9.2 we can see how a Google looks for the keyword java books. On top of the list we can find shopping results, and below it are results from the crawler based search engines. Towards the right hand side of the screen you can find sponsored links. Importance of search engine friendly website You have now learnt about the different types of search engines. Let us now learn why a search engine friendly Website is important. Search engine friendly refers to the design of a Website that includes images, videos, menus, content management system and various other elements that help a search engine to get the maximum information about the Website for the purpose of search engine exposure. A search engine friendly Website is important because, when your Website is search engine friendly it is easy for visitors to find your Website. This could be done by listing your Website on top of all the other Websites in the list returned by a search engine. When your Website is on top of the list it generally gains the attention of the visitors and thus will motivate them to visit your Website. It is also important because in todays corporate world many organizations are building their business through Internet marketing. This Internet marketing generally starts with your organizations Website. Thus, the Website should be developed or listed in such a way that it gains the attention of the customers. It also helps you in your search engine marketing efforts. Here, search engine marketing refers to a type of internet marketing. The main intention of this is to promote your Website by allowing it to appear on the result page of the search engine by means of paid placement, paid inclusion, or contextual advertising.

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
We can even find a decrease in the costs related to the advertising or search engine marketing if you develop a search engine friendly Website. We should also note that the design of your Website affects search engine friendliness. This is because when you have a Website that contains keyword rich text the search engines spiders will be able to access the keywords easily and index it for users to access.

6) Explain Java web technologies with its types


1. Java Data Base Connectivity (JDBC): Java Data Base Connectivity is a Java application that is available in all the latest versions of JDK. This is an application developed by a private organization called JavaSoft.This is an Application Program Interface (API) and it provides a common interface for a number of databases and enables you to build higher level tools and interface applications. The JDBC API enables you to define Java classes to establish connections between databases, generate Structured Query Language (SQL) statements and so on. The SQL is the standard programming language used to create, maintain and search for data in large databases. JDBC has become the most popular standard for data access. JDBC helps the developers working with Java to develop a data access application without having knowledge of complex API's of different database available in the market. They can link different type of databases and form a single database with the help of JDBC easily. Regardless of the platform that you use, JDBC helps you to establish an interface between the database and Java application. Usually, this interface is established using the JDBC drivers. These drivers are a setoff classes and interfaces that helps your Java application to interact with the databases. Basically, there are two types of JDBC architecture: the JDBC 2-tier and JDBC 3-tier architectures. JDBC 2-tier architecture: In this architecture the Java application communicates directly with the database through JDBC. The database may be located on the same system or on another computer in the network. Therefore, it is called two tire or two layered architecture. The JDBC and the Java application together form one tier that will directly communicate with the second tier, i.e., the database and access the required information. JDBC 3-tier architecture: In this architecture along with the two layers that we learnt in 2-tierarchitecture, there is one more layer in between these two layers. This middle tier or layer acts a link between the JDBC and database. First, the request from the Java application will be sent to the middle layer, the middle layer then sends the request to the database. The database again sends back the requested information to the middle tire and then to the Java application via JDBC. The purpose of the middle layer is to handle any application or business specific rules for applications that access the database. 2. Struts: Struts is developed using the technologies, the JSP and servlets. It proves to be more efficient and effective in developing Web applications. The Apache struts offer two major versions of struts framework, the struts 1 and struts 1.x frameworks. The "struts 1" is still the most popular framework for Web based applications. Even though "struts 1.x" Is a more advance framework than "struts 1", "struts 1" is still the most preferred choice of most of the Web developers. Advantages of struts:

Master of Business Administration- MBA Semester 4 MI0041 Java and Web Design-4 Credits (Book ID: B1327)
It enables you to make global changes in the Web documents by editing a single file and these changes can be made without recompiling or modifying the Java code. t provides you a collection of JSP tags that will help you to easily output the properties of JavaBeans components. A JavaBean component provides standard methods to fetch and update information in an object. It provides a group of JSP tags to create HTML forms that are associated with the JavaBeans components. It helps you to validate the contents of form fields. This is possible since the struts can check if the form values are in proper format as per the requirement. If there is any error or mistake in the format, the form can be automatically redisplayed with the error message. 3. Java Sever Faces (JSF): JSF is a new standard framework for Web application development using Java. You can consider JSF framework as a toolbox that contains a large set of components which you can use quickly and easily as per you requirements. You can use and reuse the JSF components in the same Webpage, a number of times. The JSF is available as a part of JDK Benefits of using JSF: It provides standard and reusable components which you can use to create user interfaces for Web applications. It provides many tags for accessing and manipulating the components. The form data is automatically saved and repopulated when it is displayed at client side. Many Graphic User Interface (GUI) components are available in JSF that makes Web based applications based on JSF framework more simple and effective. Two types of components in JSF: Standard UI components: This type contains most of the basic set of UI components such as text fields, check boxes, list boxes, radio buttons and so on (refer Unit 3 for component description). Some of the UI components that you can find in JSF are UIForm: This represents a Web form that contains various other components to make it a component i.e. number of components are grouped together to form a single component. UICommand: This represents UI components like buttons, hyperlinks, menu items and so on .UIInput: This represents input UI components such as text input fields, numeric input fields and so on. Custom UI components: Usually, while designing UIs you need some different and stylish components to make the component appear more attractive for example, fancy calendar, stylish table borders and soon. These are not standard type of JSF components but, designed as per the requirement. Therefore, they are called custom UI components. Thus, with the help of this the JSF enables you to create and use your own set of reusable components. Features of JSF: It is a standard Web user interface framework for Java based applications. It is built with the servlet API as its base architecture. It is a component-based framework and hence highly flexible. User Interface (UI) components can be stored on the server. Components from other technologies can be used effectively.

You might also like