Pages

Showing posts with label web programming. Show all posts
Showing posts with label web programming. Show all posts

Monday, September 9, 2013

Introduction to Web Programming

1Differentiate between Java & Java scripts.
Java :-
Java Programming language, is an OOP Language and development environment, application environment, deployment environment. It is  standalone programming Language that do not require a web browser to execute.
Java script:
It is a contained in the HTML source of webpage. It controls document appearance and content.
It also manipulates embedded images and it also interacts with Applets. Its advantage is that it is simplified,

it doesn’t have to be compiled and the source code resides within our HTML document.

1 What are cookies? And why are cookies used for?
Cookies are small text strings you store on a user's computer. Cookies store information for tracking users in  name-value pairs. When you first visit a website it may store a cookie on your computer. Next, when you again visit the site it may read or manipulate the value of the cookie and perform an action based on it. For example, if a site allows you to customize the color of the user interface, it may set the color selected by you in a cookie on your computer and read the color value when next time you request the page of the website. The page can them be displayed in the color stored in the cookie.

2What is XML? Give the XML document.
XML is a simple, common format for representing structured information as text. You can create your own tags to define and structure data, and transmit it.  The basic syntax of XML is extremely simple. As with HTML, XML represents information as text using tags to add structure. A tag begins with a name in between angular brackets (<>). In XML, every tag must have a closing tag. An opening tag, closing tag and any content in between are collectively referred to as an element of an XML document. Elements can contain other elements but they must be properly nested. Elements can also contain text or a combination of elements and text.

Tuesday, September 3, 2013

Complete Guide to Web Programming - Step 1

What are text nodes?
If a node contains text, it is represented as a text node. For example, in<p id-node2>"This is the <b>initial</b>text.</p>, there are text nodes "This is the", "initial", and "text".

 What is CGI? Give examples of CGI application.
Common Gateway Interface is a specification, which allows Web users to run programs from their computers. CGI is not a programming language but rather a specification that allows programs and scripts written in other language to be run over the Internet.

What is Query String?
QUERY_STRING:The query information passed to the program. It is appended to the URL with a ?when the browser sends it to the server. The name value pairs are then stored in this environment variable.

 What is Extra Path Information?
Besides passing query information to a CGI script, you can also pass additional data known as extra path information as part of the URL. The server gauges where the CGI program name ends; anything following that is deemed as extra path information and stored in the PATH_INFO environment variable. For example the following line calls a script with extra path information:

 What is a web server?
The Web server is the software responsible for accepting browsers' requests, retrieving the specified file or executing the script, and returning its content to the browser. Popular Web servers include Tomcat, Apache, and IIS.

 List out differences between web server and application server.
The main differences between Web servers and application servers are:
A Web server is where Web components are deployed and run. An application server is where components that implement the business logic are deployed. For example, in a JSP-EJB Web application, the JSP pages will be deployed on the Web server whereas the EJB components will be deployed on the application servers.
A Web server usually supports only HTTP (and sometimes SMTP and FTP). However, an application server supports HTTP as well as various other protocols such as SOAP.
In other word
Difference between AppServer and a Web server
(1) Webserver serves pages for viewing in web browser, application server provides exposes business logic for client applications through various protocols
(2) Webserver exclusively handles http requests. Application server serves business logic to application programs through any number of protocols.
(3) Webserver delegation model is fairly simple, when the request comes into the web server, it simply passes the request to the program best able to handle it(Server side program). It may not support transactions and database connection pooling.
(4) Application server is more capable of dynamic behavior than webserver. We can also configure application server to work as a web server.Simplyapplication server is a superset of web server.

1 Describe role of deployment descriptors.
A deployment descriptor is an XML document that defines all the components of an application along with related information such as initialization parameters and container managed security constraints that you want the server to enforce. This file helps the server to know crucial details about the application.

1What is a war file? Give its importance.
WAR or Web Application Archive file is packaged servlet Web application. Servlet applications are usually distributed as a WAR files.
                              WAR file (which stands for "web application archive" ) is a JAR file used to distribute a collection of JavaServer Pages, servlets, Javaclasses, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application.

How to specify session time out in Web.XML?
You can specify session timeout in the <session-timeout> attribute of the <session-config> element. For example, to specify a session timeout of 30 minutes use:
<session-config>
<session-timeout>30</session-timeout>
</session-config>

Complete Guide to Web Programming

What is Web

A Web is a complex network of international, cross platform, and cross cultural communicating devices, connected to each other without any ordering or pattern.

 What is the difference between intranet and internet


Internet and Intranet are both networks. However, the Internet is a network of networks, involving all communicating devices over the Web. However, an Intranet is limited to the users, machines, and software programs of a specific organization.

Describe HTML tags and elements in briefly

An HTML tag defines the markup for a particular content in an HTML page and is represented within angular brackets. A start tag is represented as <tag_name> and an end tag is represented as </tag_name>. Most tags in HTML are in pairs of start and end tag. Only some tags such as <br> do not have an end tag.
An element contains a start tag, an end tag, and the content, which is marked up by those tags. The content in an element may comprise of data as well as nested tags. For example, the following is an HTML element:
<body>
<p>This is a nested tag</p>
</body>
An HTML page starts and end with <HTML></HTML> tags, marking the beginning and end of an HTML page. A page can be divided into the header and the body. The <HEAD></HEAD> tags represent the former and contain header information, which is not displayed in the browser window. The <HEAD></HEAD> tags also contain the <TITLE></TITLE> tags, which contain the text that will be displayed in the title bar of the browser window when the page is opened.
The <BODY></BODY> tags comprise the body element of an HTML page. The content with the <BODY></BODY> tags is displayed in the browser window.

   What is Java Script?
 JavaScript is a scripting language used to make interactive web pages. It is mostly used as a client side scripting language. Its uses include:

List out uses of Java Script.
  • Control document appearance and content
  • Control the browser
  •  Interact with document content
  •  Interact with user
  •  Read and write client state with cookies
  •  Interact with applets
  • Manipulate embedded images

  What are the difference between HTML and DHTML
HTML is a markup language used to create static web pages. DHTML on the other hand is not a language by itself but a combination of different technologies such as HTML, CSS, JavaScript, and DOM. It is used to create dynamic pages.