Dear
students get fully solved assignments
Send
your semester & Specialization name to our mail id :
“
help.mbaassignments@gmail.com ”
or
Call
us at : 08263069601
ASSIGNMENT
PROGRAM
|
BSc IT
|
SEMESTER
|
FOURTH
|
SUBJECT CODE & NAME
|
BT0083,Server Side Programming-Theory
|
CREDIT
|
4
|
BK ID
|
B1088
|
MAX.MARKS
|
60
|
Q1.Define
and explain web servers and application servers.
Answer: A Web server exclusively handles
HTTP requests, whereas an application server serves business logic to
application programs through any number of protocols.
Let's examine each in more detail.
The
Web server
A Web server handles the HTTP protocol.
When the Web server receives an HTTP request, it responds with an HTTP
response, such as sending back an HTML page. To process a request, a Web server
may respond with a static HTML page or image, send a redirect, or delegate the
dynamic response generation to some other program such as CGI scripts, JSPs
(JavaServer Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts,
or some other server-side technology. Whatever their purpose, such server-side
programs generate a response, most often in HTML, for viewing in a Web browser.
Q2 Explain
Servlet methods used to retrieve data from HTML form. Give an examples.
Answer: Handling
form data represented in HTML page is a very common task in web development. A
typical scenario is the user fills in fields of a form and submits it. The
server will process the request based on the submitted data, and send response
back to the client. The following picture depicts that workflow with Java
servlet on the server side:
Q.3
Describe the following exception handling methods in a servlet with the help of
examples
1.
Using the web.xml file
2
Using a RequestDispatcher
1.
Using the web.xml file
Answer: When a servlet throws an
exception, the web container searches the configurations in web.xml that use
the exception-type element for a match with the thrown exception type.
We would have to use the error-page
element in web.xml to specify the invocation of servlets in response to certain
exceptions or HTTP status codes. Consider, you have an ErrorHandler servlet
which would be called whenever there is any defined exception or error.
Following would be the entry created in web.xml.
Q2
Using a RequestDispatcher
Answer: The Request Dispatcher interface
provides the facility of dispatching the request to another resource it may be
html, servlet or jsp. This interface can also be used to include the content of
another resource also. It is one of the way of servlet collaboration.
There
are two methods defined in the Request Dispatcher interface.
Forward
method:
Q.4
Explain the two JSP architectures.
Answer: - The JSP specification presents two approaches for building web
applications using JSP pages: JSP Model 1 and Model 2 architectures. These two
models differ in the location where the processing takes place. In Model 1
architecture, the JSP page is responsible for processing requests and sending
back replies to clients.
The Model 2 architecture, integrates the
use of both servlets and JSP pages. In this mode, JSP pages are used for the
presentation layer, and servlets for processing tasks. The servlet acts as a
controller responsible for processing requests and creating any beans needed by
the JSP page. The controller is also responsible for deciding to which JSP page
to forward the request. The JSP page retrieves objects created by the servlet
and extracts dynamic content for insertion within a template.
This model promotes the use of the Model
View
Q5.
Draw and explain the diagram of custom tag life cycle.
Answer: The life cycle of a JavaServer
Faces page is somewhat similar to that of a JSP page: The client makes an HTTP
request for the page, and the server responds with the page translated to HTML.
However, the JavaServer Faces life cycle differs from the JSP life cycle in
that it is split up into multiple phases in order to support the sophisticated UI
component model. This model requires that component data be converted and
validated, component events be handled, and component data be propagated to
beans in an orderly fashion.
A JavaServer Faces page is also different
from a JSP page in that it is represented by a tree of UI components, called a
view. During the life cycle, the
Q.6
Describe the process of deactivating Individual Expression Language Statements
with example.
Answer:- Deactivating the Expression
Language in an Entire Web Application:-
The JSP 2.0 expression language is
automatically in web applications whose deployed descriptor refers to servlet
specification version 2.3 or earlier.
On the other hand, the following web.xml file is compatible with JSP2.0 and
thus stipulates that the expression
language should be activated by default.
Dear
students get fully solved assignments
Send
your semester & Specialization name to our mail id :
“
help.mbaassignments@gmail.com ”
or
Call
us at : 08263069601
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.