FINALTERM EXAMINATION
Spring 2010
CS506- Web Design and Development (
Time: 90 min
Marks: 60
Question No: 23 ( Marks: 1 ) - Please choose one
Servlet mapping of a servlet is defined in _____________ file.
► JSP
► HTML
► web.xml
► Servlet
Question No: 24 ( Marks: 1 ) - Please choose one
By using forward() method of _________ object, the called resource will be able to access the original request object.
► HttpServletRequest
► HttpServletResponse
► RequestDispatcher
► ServletConfig
Question No: 25 ( Marks: 1 ) - Please choose one
A --------in HashMap is associated with each object that is stored.
► None of the given options
► Key
► Value
► Attribute
Question No: 26 ( Marks: 1 ) - Please choose one
Which of the following must be used to compare the values of two strings?
► = operator
► == operator
► equals() method
► compare() method
Question No: 27 ( Marks: 1 ) - Please choose one
Mouse events can be trapped for ________ GUI component.
► JFrame
► JPanel
► JButton
► All of the given options
Question No: 28 ( Marks: 1 ) - Please choose one
Port is a transport address to which processes can ________ for connections request.
► read
► Write
► Listen
► None of the given options
Question No: 29 ( Marks: 1 ) - Please choose one
In which file do we define a servlet mapping?
► Web.xml
► index.html
► Servlet.xml
► None of the given options
Question No: 30 ( Marks: 1 ) - Please choose one
Which of the following is appropriate for Page-with-Bean approach?
► The code becomes a mixture of presentation, business and data access logic.
► The maintenance of the application becomes a nightmare.
► A lot of code is also get duplicated.
► All the business logic goes into one application.
Question No: 31 ( Marks: 2 )
How to track a user session in Servlets?
Answer:
the user can be tracked in a serlver by it’s state stored on the client side. These states are stored in the form of text or some values etc. this can also be a cookie. By storing this on the use side, user can be tracked by using the information written in it.
Question No: 32 ( Marks: 2 )
Why do we use doTag() method in tag handler class?
Answer: the dotag() method is used to implement/override to code functionality of tag. And this is invoked when the end element of the tag encountered.
Question No: 33 ( Marks: 2 )
Differentiate between Layers and Tiers.
Answer:
Layers are simply logical grouping of the software components that make up the application or service, whereas Tiers refer to the physical residence of those layers. In simple words layers represents the logical view of application while Tiers represents physical view of application.
Question No: 34 ( Marks: 2 )
Why is direct call of paint() method not recommended?
Answer:
The direct call of paint() is not recommended because all the graphical processes done automatically by the computer and is does not feel due to the modern computers processing speed. So we don’t call paint() method by recommendation.
Question No: 35 ( Marks: 3 )
What is the preferred size of a component?
Question No: 36 ( Marks: 3 )
Name three stages of servlet life cycle.
Answer:
three stages of servlet life cycle are:
1- Initialize
2- Service
3- destroy
Question No: 37 ( Marks: 3 )
What is the difference between variable declared inside a declaration part and variable declared in scriplet part?
Question No: 38 ( Marks: 3 )
How does JSF provide Navigation?
Answer: JSF navigation determines the control flow of the web application. Jsf provide a default navigational handler and this behavior can be configured in the configuration. We can do this also visually by using tools like sun studio creator.
Question No: 39 ( Marks: 5 )
What is expression in JSP? Give an example.
Question No: 40 ( Marks: 5 )
What is validator? Discuss built-in-validators.