Monday, 26 August 2013

unit 3

WEB TECHNOLOGY
UNIT-III

 1. What are Servlets?
A small program that runs on a server, the term usually refers to a Java applet that runs
within a Web server environment. This is analogous to a Java applet that runs within a Web browser environment. Java servlets are becoming increasingly popular as an alternative to CGI programs. The biggest difference between the two is that a Java applet is persistent.

2. What are the stages in a Servlet life cycle?
1.init()
2.service()
3.destroy()

3. What do you mean by Server-side?
Occurring on the server side of a client-server system. For example, on the World Wide
Web, CGI scripts are server-side applications because they run on the Web server. In contrast,JavaScript scripts are client-side because they are executed by your browser (the client). Java applets can be either server-side or client- side depending on which computer (the server or the client) executes them.

4. Define  ServletContext
ServletContext interface is a window for a servlet to view it\'s environment. A servlet can use this interface to get information such as initialization parameters for the web applicationor servlet container\'s version. Every web application has one and only one ServletContext and is accessible to all active resource of that application.

5. What is preinitialization of a servlet?
A container doesnot initialize the servlets ass soon as it starts up, it initializes a servlet when it receives a request for that servlet first time. This is called lazy loading. The servlet specification defines the <load-on-startup> element, which can be specified in the deployment descriptor to make the servlet container load and initialize the servlet as soon as it starts up. The process of loading a servlet before any request comes in is called preloading or preinitializing a servlet.

 6. What is the difference between HttpServlet and GenericServlet?
A GenericServlet has a service() method aimed to handle requests. HttpServlet extends GenericServlet and adds support for doGet(), doPost(), doHead() methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods (HTTP 1.1).
Both these classes are abstract.


 7. What is the difference between ServletContext and ServletConfig?
ServletContext: Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized.

 8.What is rollover effect?
An image changes when we place the mouse over it,and changes back when the mouse
moves away from the image.

9.Illustrate the general steps to run a servlet.
1.Compile the servlet using an appropriate compiler version.
2.Copy the resulting .class file to the appropriate directory for our java-servlet
capable server.
3.Start the server
4.Navigate to the URL corresponding to the servlet.

10. Define Java Server Pages?
It can be defined as one instantiation of a class of related technologies that facilitate
separate development of a website’s presentation and logic. The key contribution of these
technologies is to embed program code related to presentation within a document.

11. What is a Scriplet?
A Scriplet is a fragment of java code that is embedded within the JSP document.

12. What are the drawbacks of two-step approach in JSP over direct interpretation?
1.Debugging
2.Delay during the first time a JSP document is requested.


13. Define a Web Application?
To implement larger tasks, a large collection of resources such as Servlets,JSP
documents, Utility and Support Java Classes, Static HTML documents, Style Sheets, JavaScript files, Images are needed that work together in order to provide what appears to an end user to be a single software application.. Such a collection of resources is known as a web application..

14. Write the steps for installing a Web Application?
1.Create a directory under the webapps subdirectory.
2.Place the JSP document in the new subdirectory.
3.Deploy the application to the sever.


15. What is meant by deploying the application to the server?
During the installation of a web application, after loading the JSP document in the
subdirectory, the server have to be notified that a new web application is available. This step is known as deploying the application to the server.

16. Name the three types of information available in a valid JSP document?
1.JSP markup
2.Expression Language(EL)expressions
3.Template data

17.Name the two types of directives available for use in a JSP document?
1.Page-The page directive(directive. page element) has a variety of attributes
that may be set.
2.Include-The include directive(directive. include element) imports text from
another file into the JSP document at the point at which the directive
appears.

18. What is known as a Translation Unit?
A top-level JSP document plus all of the segments it includes either directly or indirectly
through include directives in segments is known as a translation unit, because the translator effectively assembles all of the text from these files into a single JSP document which is then translated.

19. What are the three categories of JSP element types?
1.Scripting
2.Directive
3.Action

20. Write about the JSP action element?
It is an element that is translated into javaservlet code that performs some action. These
elements provide standard actions ie, the actions that are required by the JSP specification to be provided by any JSP-compliant container. The JSP tag library mechanism allows
additional action elements to be used within a JSP document, which provide custom actions.

21. Define a Scoped variable.
It is a non implicit EL variable, that is an attribute of one of the page ,request ,session,or
application objects. The object containing the attribute is called the scope of the variable and hence the name scoped variable




22. Define JavaBeans Technology.
A simple mechanism to call java methods from within a JSP document.JSP provides sucha mechanism through its support for JavaBeans classes.If a java class is written so as toconform with certain aspects of the JavaBeans Specification,the certain methods of this class can be called from a JSP document.

23.What is the use of JSP?
JSP enable web application programmers to create dynamic content by reusing
predefined components and by interacting with components using server side scripting.

24.What are directives?
Directives are messages to the jsp container that enables the programmer to specify page
settings, to include content from other resources and to specify custom-tag libraries for use in JSP.

25. What are the four key components of JSP?
Directives, actions, scriptlets and tag libraries

26. Name some JSP standard actions?
<jsp:include>, <jsp:forward>, <jsp:plugin>, <jsp:param> and <jsp:useBean>

27. What is page Directive?
The page directive specifies global settings for the JSP in the JSP container.

28. What are the attributes of the page directive?
Language, extends, import, session, buffer, info, errrorPage

29. What is include Directive?
The include directive includes the content of another resource once, at JSP translation time.The include directive has only one attribute file.

30. What is scope of implicit objects?
The implicit objects have four scopes: application, page, request and session

31.. Classes and interfaces specific to JSP Programming are located in which package?
Javax.servlet.jsp and javax.servlet.jsp.tagext

32. Classes and interfaces specific to servlets are located in which package?
Javax.servlet and javax.servlet.http



33. What is the key method in every Servlet?
The key method in every Servlet is method service, which receives both a servletRequest object and a servletResponse object

34. List out the Web Service Pack in J2EE?
Java API for XML Processing (JAXP)
Java Architecture for XML Binding (JAXB)
Java API for XML Messaging (JAXM)
Java API for XMP Remote Procedure Calls (JAX-RPC)
Java API for XML Registries (JAXR)

35. What is SunONE?
SunONE is Sun’s opened net environment. It is a framework for creating and
deploying web services from Sun’s J2EE framework. It relies on XML, SOAP and Java to add Web Services extensions to bridge a gap between the loosely coupled and tighylycoupled object framework.


36. What is ECLIPSE?
Eclipse is an open-source, Java-based software platform designed for buildings
IDEs. Eclipse is an effort to reduce the complexity associated with building applications
that rely on other applications and services.

37. What is BEA?
BEA is an application service provider that targets e-business solutions. BEA
WebLogic server, a java-based middle-tier server that integrates Web-based front ends with back-end data stores.

38. Define J2EE
   J2EE is the Java-centric enterprise platform specification. J2EE is used to built web
sites and application around Enterprise Java Bean (EJB.). Recently it has been extended to include support for XML and Web Services.


No comments:

Post a Comment