Web Programming FAQ


Mention the benefits of JavaScript.

JavaScript is primarily a client-side language. Advantages of JavaScript are
Simple and versatile – can be used with other languages and in a huge variety of applications
Speed – code functions can be run immediately in client machine instead of having to contact the server and wait for an answer.
Reduces Server Load

What is a session? What is session management and why it is required?

Session is an interval of time during which a connection exists between a server and a client. The state of the client is maintained at the server during the session and since http is a stateless protocol the state information does not persist when the connection is terminated.

Session management also called as session tracking is a way to maintain state (data) of an user across multiple sessions. There are four techniques used in Session tracking:
Cookies
Hidden Form Field
URL Rewriting
HttpSession



Define RMI.

RMI is remote Method Invocation. RMI allows remote communication and is used to build distributed applications in Java. RMI allows a Java object residing in one machine to invoke a method which resides in another (Remote) machine.



What are stub and skeletons?

Stub is a Java object that resides on the client machine. Its function is to provide the same interface as the remote server. A skeleton is a Java object that resides on the server machine. It receives request performs serialization and invokes the appropriate code on the server.

What is the function of bind(), rebind() and lookup() methods?

bind() – register an object and name in RMI registry
     rebind() – modify the existing registered object.
lookup() – search for an object using name.



Define marshalling and unmarshalling.

Marshalling is the process of converting data or object into a byte stream. The reverse process of converting the byte stream into original data or object is called as unmarshalling. The conversion is achieved through serialization.



What is the use of 'param' variable in JSP?

‘param’ is one of the implicit objects in JSP. It maps the request parameter to a single value. Example
<jsp:param name=”first_name” value=”xyz”/>



What are the types of directives in JSP?

Types of directive tags
page directive – defines page dependent attributes example the scripting language used by the JSP
include directive – include file in the JSP during the translation page
taglib directive – allows to create user define tags that implement custom behavior



List any 4 taglib directives available in JSP and their use.

Tag library contains a set of user defined tags that implement custom behavior. The taglib directive declares that JSP page uses a set of custom tags, identifies the location of the library and provides a means of identifying the custom tags in the JSP page.



Differentiate Http and generic servlet

GenericServlet
HttpServlet
Abstract class
Abstract class
Direct subclass of servlet class
Direct subclass of GeneriServlet class
Defines a generic protocol independent servlet – It handles all types  of protocol  like http, smtp, ftp etc.
Defines a HTTP protocol specific servlet – It handles only http protocol.




What is namespaces in XML? Give an example.
What are Namespaces? Why is it useful? Explain with an example.
Justify the need for namespaces in XML.

In XML, element names are defined by the developer. This often results in a conflict when trying to use XML documents from different applications together. XML Namespace is used to avoid element name conflict in XML documents. It provide a means for document authors to unambiguously refer to elements with the same name (i.e., prevent collisions).

For example,
<subject>Geometry</subject>       and
<subject>Cardiology</subject>
use element subject to mark up data.
In the first case, the subject is something one studies in school, whereas in the second case, the subject is a field of medicine.
Namespaces can differentiate these two subject elements—for example:
<highschool:subject>Geometry</highschool:subject>               and
<medicalschool:subject>Cardiology</medicalschool:subject>



What is XML Parser?

An XML parser is a software library or package that provides interface for client applications to work with an XML document.
It is designed to read XML document and create a way for programs to use the XML
It validates the documents and checks if the document is well formed.



State the function of DTD.

Document Type Definition (DTD) is used to define the structure of an XML document. It contains a list of legal elements and defines the structure with the help of them. It can also be used to define special characters and character strings used in the document.



Explain the use of DTD for structuring the XML document.
What are the benefits of using XML Schema?
State the differences between XML Schema and DTD.
Compare DTD and XML schema.

Both DTD and XML schema provides the basic structure for defining a XML document. In addition XML schema also provides methods to define constraints on the data contained in the document. XML schema is considered to be richer and more powerful than DTD.

Drawback in DTD

DTDs are not flexible enough to meet today’s programming needs. For example, DTDs lack a way of indicating what specific type of data (e.g., numeric, text) an element can contain,
DTDs are not themselves XML documents, forcing developers to learn multiple grammars and developers to create multiple types of parsers.

Unlike DTDs, schemas do not use EBNF grammar. Instead, they use XML syntax and are actually XML documents that programs can manipulate. Like DTDs, schemas are used by validating parsers to validate documents.



Advantage of using Schemas over DTD
It is easier to describe document content
It is easier to define restrictions on data
It is easier to validate the correctness of data
It is easier to convert data between different data types



What is the function of XSLT?
What is the use of XSLT?
eXtensible Stylesheet Language Transformation (XSLT) is used to transform an XML document into other type of document like HTML. With XSLT we ca add / remove elements and attributes to or from an output file. We can also rearrange and sort elements, perform tests and make decisions about which element to hide, display etc.



What are the various transformation technologies?

XSL Transformations (XSLT) – is a technology for transforming XML documents into other documents – i.e., transforming the structure of the XML document data to another structure.

XSLT provides elements that define rules for transforming one XML document to produce a different XML document. Transforming an XML document using XSLT involves two tree structures – the source tree (XML document to transform) and the result tree (XML document to create).

To perform transformations, an XSLT processor is required. Popular XSLT processors include Microsoft’s MSXML and the Apache Software Foundation’s Xalan 2 (xml.apache.org).



What are presentation technologies of XML? Explain each one briefly.

Extensible Stylesheet Language (XSL) documents specify how programs are to render XML document data.  XSL is a group of three technologies—XSL-FO (XSL Formatting Objects), XPath (XML Path Language) and XSLT (XSL Transformations).

XSL-FO is a vocabulary for specifying formatting

XPath is a string-based language of expressions used by XML and many of its related technologies for effectively and efficiently locating structures and data (such as specific elements and attributes) in XML documents.

XSL Transformations (XSLT) – is a technology for transforming XML documents into other documents – i.e., transforming the structure of the XML document data to another structure.



What is Xpath?

Xpath is syntax for defining path of a XML document. Xpath uses a string-based language of expressions to navigate in XML documents. It is used for effectively and efficiently locating structures and data (such as specific elements and attributes) in XML documents



What is XSL and why is it used?

eXtensible Stylesheet Language (XSL) is used for expressing stylesheets in XML. An XSL is a file that describes how to display an XML document of a given type.




No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu