🔥BCS-053🔥2021-22 Exams - Google Docs PDF

Title 🔥BCS-053🔥2021-22 Exams - Google Docs
Author PREMSAGAR VED
Course Bachelor of computer application
Institution Indira Gandhi National Open University
Pages 12
File Size 328 KB
File Type PDF
Total Downloads 198
Total Views 832

Summary

🔥 BCS-053 ጉWeb Programming ✔ ✔@ Bca studies 💙(2021-22) 👍 100% guranteed ៰ ● ጉ Most Important question ጉ Explain the following HTML elements : (i) < TEXTAREA > tag Sol. <textarea>: The Textarea element. The <textarea> HTML element represents a multi-line plain-text editing control, ...


Description

BCS-053 Web Programming ✔@Bca studies



(2021-22) 100% guranteed Most Important question

1. Explain the following HTML elements : (i) < TEXTAREA > tag Sol. : The Textarea element. The HTML element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form. (ii) < TABLE > tag Sol. The tag defines an HTML table. An HTML table consists of one element and one or more , , and elements. The element defines a table row, the element defines a table header, and the element defines a table cell. (iii) ANCHOR element Sol. Anchor tag- The HTML code for creating a link to another page or to a particular section within a page. It is also commonly called an "h-ref." For example: -The tag defines a hyperlink, which is used to link from one page to another. (iv) < MENU > tag Sol. HTML tag specifies a list or menu of commands that a user can perform or activate. It is used for creating context menu as well as lists menu. 2. How is WML different than HTML ? Write WML script that displays your enrolment number and name in the centre of the screen? 3. Discuss the advantages of Web 2.0 over its previous version. Explain with the help of example? Sol. Advantages of web 2.0 ● Available at any time, any place. ● Variety of media. ● Ease of usage. ● Learners can actively be involved in knowledge building. ● Can create dynamic learning communities. ● Everybody is the author and the editor, every edit that has been made can be tracked. ● User-friendly. ● Updates in the wiki are immediate and it offers more sources for researchers. ● It provides real-time discussion. 4. What is session tracking ? Explain the use of cookies for session tracking with the help of an example?

Sol. Session Tracking tracks a user's requests and maintains their state. It is a mechanism used to store information on specific users and in order to recognize these user's requests when they connect to the web server. HTTP is a stateless protocol where each request to the server is treated like a new request. Cookies are the mostly used technology for session tracking. Cookie is a key value pair of information, sent by the server to the browser. This should be saved by the browser in its space in the client computer. Whenever the browser sends a request to that server it sends the cookie along with it. 5. What are the uses of GET and POST methods of HTTP ? Also explain the differences between GET and POST? Sol. The GET Method:GET is used to request data from a specified resource. GET is one of the most common HTTP methods. Note that the query string (name/value pairs) is sent in the URL of a GET request: /test/demo_form.php?name1=value1&name2=value2 Some other notes on GET requests: ● GET requests can be cached ● GET requests remain in the browser history ● GET requests can be bookmarked ● GET requests should never be used when dealing with sensitive data ● GET requests have length restrictions ● GET requests are only used to request data (not modify) The POST Method:POST is used to send data to a server to create/update a resource. The data sent to the server with POST is stored in the request body of the HTTP request: POST /test/demo_form.php HTTP/1.1 Host: w3schools.com name1= value1&name2=value2 POST is one of the most common HTTP methods. Some other notes on POST requests: ● ● ● ●

POST requests are never cached POST requests do not remain in the browser history POST requests cannot be bookmarked POST requests have no restrictions on data length

6. Explain the JSP compilation time error and JSP request time errors? Sol. 1. Translation Time Error : This type of Error occurs during the initial request. When a JSP page is first requested and goes through the initial translation from a JSP source file into a corresponding Servlet class file. These errors are usually the result of compilation failures and are known as Translation Time Errors. They are reported to the requesting Client with an Error Status Code 500 or Server Error and usually contain the reported compilation error. Translation Time Errors are handled by the JSP Engine. 2. JSP Request Time Error : This type of Error occurs during subsequent requests. These Errors are Run-Time errors that can occur in either the body of the JSP page or in some other object that is called from the body of the JSP Page. Request Time Errors result in an Exception being thrown. These Exceptions can be caught and appropriately handled in the body of the calling JSP, which would be the end of the error. Those Exceptions that are not caught result in the forwarding of the Client request, including the Uncaught Exception, to the Error Page specified by the offending JSP. 7. What is the purpose of class selector in CSS ? Explain with the help of an example. Sol. The .class selector is used to select all elements which belong to a particular class attribute. In order to select the elements with a particular class, use the period (.) character specifying the class name ie., it will match the HTML element based on the contents of their class attribute. The class name is mostly used to set the CSS property to a given class. Syntax: .class { // CSS property } Example 1: This example demonstrates the class Selector for the specific HTML element.





GeeksforGeeks

.class Selector

GeeksforGeeks: A computer science portal



8. A student fee table contains information about student enrolment number and amount of fee paid by a student. A student can pay fee only once. Assuming that a connection has already been created, write JSP code that accesses data from the database for the enrolment number "1701" and displays this data. Make suitable assumptions, if any? 9. Explain the uses of XML CSS and XML, XSLT? Sol. CSS:- CSS can be used to display the contents of the XML document in a clear and precise manner. It gives the design and style to whole XML document. Define the style rules for the text elements such as font-size, color, font-weight, etc. XML XSLT :- With XSLT you can add/remove elements and attributes to or from the output file. You can also rearrange and sort elements, perform tests and make decisions about which elements to hide and display, and a lot more. XSLT uses XPath to find information in an XML document. 10. Define the following terms : (i) WML Tasks Sol. A WML task is an element that specifies an action to be performed by the browser, rather than something to be displayed. For example, the action of changing to a new card is represented by a task element, and the action of returning to the previous card visited is represented by a task element. Task elements encapsulate all the information required to perform the action. WML provides following four elements to handle four WML tasks called go task, pre task, refresh task and noop taks. (ii)XML Schemas Sol. XML schema is a language which is used for expressing constraint about XML documents. There are so many schema languages which are used now a days for example Relax- NG and XSD (XML schema definition). An XML schema is used to define the structure of an XML document. It is like DTD but provides more control on XML structure. (iii)WAP Protocol Stack Sol. WAP stands for Wireless Application Protocol. It is a protocol designed for micro-browsers and it enables the access of internet in the mobile devices. It uses the mark-up language WML (Wireless Markup Language and not HTML), WML is defined as XML 1.0 application. WAP Model: The user opens the mini-browser in a mobile device. He selects a website that he wants to view. The mobile device sends the URL encoded request via network to a WAP gateway using WAP protocol.

(iv) HTML DOM Sol. The Document Object Model (DOM) is a programming interface for HTML and XML(Extensible markup language) documents. It defines the logical structure of documents and the way a document is accessed and manipulated Properties of DOM: Let’s see the properties of the document object that can be accessed and modified by the document object.

● ●

Window Object: Window Object is always at top of the hierarchy. Document object: When an HTML document is loaded into a window, it becomes a document object. ● Form Object: It is represented by form tags. ● Link Object: It is represented by link tags. ● Anchor Object: It is represented by a href tags. ● Form Control Elements:: Form can have many control elements such as text fields, buttons, radio buttons, and checkboxes, etc. Methods of Document Object: ● ● ● ● ●

write(“string”): Writes the given string on the document. getElementById(): returns the element having the given id value. getElementsByName(): returns all the elements having the given name value. getElementsByTagName(): returns all the elements having the given tag name. getElementsByClassName(): returns all the elements having the given class name. 11. Explain the method getElementBy Id( ) in JavaScript with the help of an example? Sol. The getElementById() is a DOM method used to return the element that has the ID attribute with the specified value. This is one of the most common methods in the HTML DOM and is used almost every time we want to manipulate an element on our document. This method returns null if no elements with the specified ID exists. The ID should be unique within a page. However, if more than one element with the specified ID exists, it returns the last element in the javascript code. Example-1

In the following example, there exists a paragraph tag with the inner text "GetElementById" and with an id called "element". Using the DOM method "document.getElementById()" the text inside the paragraph tag is accessed and the value is displayed in the output. Without ".innerHtml" the document.getElementById can't read the inner text part of any tag.

GetElementById

Output GetElementById GetElementById 12. Explain the following with the help of an example/diagram, if needed : (a) Web container (b) Request and Response in the context of HTTP (c) Scriptlets (d) DriverManager Class (e) Controller in the context of MVC 8architecture (±) < jsp : param > tag (f) Events in HTML (g) < jsp : useBean > (h) < sql : query > (i) Social Networking (j) XML Schemas (k) and tags cif HTML5 (l) Session Object (m) Need of JSP (n) GET Method of HTTP (o) include Directive in JSP (p) JDBC-ODBC Bridge (q) Scriplets in JSP (r) Uses of tag (s) Page Directive of JSP (t) POST Method of HTTP (u) DriverManager class in JSP (v) Loading a JDBC database driver (w) Processing the result obtained from database access, while using JSP

(x) Session Management (y) Include Directive (z) Exception handling using JSP 13. List the techniques for session tracking. Explain any one of them? Sol. Methods of Session Tracking There are four techniques used in Session Tracking: 1) Cookies 2) Hidden Form Field 3) URL Rewriting 4) HttpSession 1) Cookies Cookies are small piece of information sent by web server in response header and gets stored in browser side. A web server can assign a unique session ID to each web client. The cookies are used maintain the session. The client can disable the cookies. 2) Hidden Form Field The hidden form field is used to insert the information in the webpages and this information is sent to the server. These fields are not viewable to the user directly. For example:...


Similar Free PDFs