JSP and Servlet Multiple Choice Questions and Answers in Java Programming.
1) What are the mechanisms available in ServletContextListener interface?
- contextInit(), contextService(), contextDestroyed()
- contextInitialized((),contextDestroyed()
- contextInitialized(), contextService(), contextDestroyed()
- None of the above
Show Answer
Answer = contextInitialized((),contextDestroyed()
2) A deployment descriptor describes
- web component response settings
- web component settings
- web component request objects
- All of the above
Show Answer
Answer = web component settings
3) Dynamic interception of requests and responses to transform the information is done by
- servlet container
- servlet config
- servlet context
- servlet filter
Show Answer
Answer = servlet filter
4) The life cycle of a servlet is managed by
- servlet context
- servlet container
- the supporting protocol (such as http or https)
- all of the above
Show Answer
Answer = servlet container
5) The include() method of RequestDispatcher
- sends a request to another resource like servlet, jsp or html
- includes resource of file like servlet, jsp or html
- appends the request and response objects to the current servlet
- None of the above
Show Answer
Answer = sends a request to another resource like servlet, jsp or html
6) The method forward(request,response) will
- return back to the same method from where the forward was invoked
- not return back to the same method from where the forward was invoked and the web pages navigation continues
- Both A and B are correct
- None of the above
Show Answer
Answer = return back to the same method from where the forward was invoked
7) What is the limit of data to be passed from HTML when doGet() method is used?
- 4K
- 8K
- 2K
- 1K
Show Answer
Answer = 2K
8) The getSession() method with ‘true’ as its parameter [ getSession(true) ] it will return the appropriate session object when
- the session is completed
- the session object is passed to another method
- the session does not exists
- the session is existing
Show Answer
Answer = the session is existing
9) Which of the following are the session tracking techniques?
- URL rewriting, using session object, using response object, using hidden fields
- URL rewriting, using session object, using cookies, using hidden fields
- URL rewriting, using servlet object, using response object, using cookies
- URL rewriting, using request object, using response object, using session object
Show Answer
Answer = URL rewriting, using session object, using cookies, using hidden fields
10) What's the difference between servlets and applets?
1.Servlets executes on Servers, where as Applets executes on Browser
2.Servlets have no GUI, where as an Applet has GUI
3.Servlets creates static web pages, where as Applets creates dynamic web pages
4.Servlets can handle only a single request, where as Applet can handle multiple requests
- 1,2,3 are correct
- 1,2 are correct
- 1,3 are correct
- 1,2,3,4 are correct
Show Answer
Answer = 1,2 are correct
For More Questions visit Here -
Do You Like This? Please take 5 seconds to share with your firends.
0 comments:
Post a Comment