WEB TECHNOLOGIES
1.The difference between Servlets and JSP is the …………….
A. translation B. compilation C. syntax D. Both A and B
2.Which of the following are the valid scopes in JSP?
A. request, page, session, application B. request, page, session, global C. response, page, session,
application D. request, page, context, application
3. Which of the following is an advantage of the statement – Separation of business logic from JSP ?
a. Custom Tags in JSP
b. JSP Standard Tag Library
c. All the above
d. None of the above
4. Which action tags are used in JSP for developing web application with Java Bean?
a. jsp:useBean
b. jsp:setProperty
c. jsp:getProperty
d. Both B & C
5. Which tag is used to execute java source code in JSP?
a. Declaration Tag
b. Scriptlet tag
c. Expression tag
d. None of the above
6. A JSP page consists of which tags?
Published on 10 Jul 15
a. HTML tags
b. JSP tags
c. Both A & B
d. None of the above
7. What are the functions of Servlet container?
A. Lifecycle management
B. Communication support
C. Multithreading support
D. All of the above
8. What is the difference between servlets and applets?
i.Servlets execute on Server; Applets execute on
browser ii.Servlets have no GUI; Applet has GUI
iii.Servlets creates static web pages; Applets creates dynamic web pages
iv.Servlets can handle only a single request; Applet can handle multiple requests
9. Which methods are used to bind the objects on HttpSession instance and get the objects?
A. setAttribute
B. getAttributewrong
C. Both A & B
correct
D. None of the above
10. Which of the following are the session tracking techniques?
A. URL rewriting, using session object, using response object, using hidden fields
B. URL rewriting, using session object, using cookies, using hidden fields correct
C. URL rewriting, using servlet object, using response object, using cookies wrong
D. URL rewriting, using request object, using response object, using session object
11. Which object is created by the web container at time of deploying the project?
A. ServletConfig
B. ServletContext correct
C. Both A & B
D. None of the above
12. In the following statements identify the disadvantages of CGI?
A. If number of clients increases, it takes more time for sending response
B. For each request, it starts a process and Web server is limited to start processes wrong
C. It uses platform dependent language e.g. C, C++, perl
D. All mentioned above
13. Which life cycle method is called once in a servlet life?
class loading
init()
service()
destroy()
14. AJAX based on
A. JavaScript and XML
B. VBScript and XML
C. JavaScript and Java
D. JavaScript and HTTP requests
15. JavaScript is interpreted by
A. Client
B. Server
C. Object
D. None of the above
17. Which is not a primitive data type in JavaScript?
A. boolean
B. number
C. string
D. character
1 What is the correct signature of jspInit() method of HttpJspPage class?
Ans.:void jspInit()
2 This object can be used to access other implicit objects in
JSP.
Ans. pageContext
3 Which of the following are the valid scopes in JSP?
request, page, session, application
4 isErrorPage is by default true.
Ans.: false (by default its false)
5 application is instance of which class?
Ans.: Javax.servlet.ServletContext
6 What is default value of isELIgnored Attribute?
Ans.: True
7 Which of the following is true about isThreadSafe
Attribute?
Ans.- The isELIgnored option gives you the ability to disable the
evaluation of Expression Language (EL expressions).
8 Which of the following is true about <jsp:useBean> action?
- useBean action first searches for an existing object utilizing
the id and scope variables. If an object is not found, it then
tries to create the specified object.
- useBean is used to load java beans in jsp page.
9 What is Localization?
The basic approach to localize a JSP page is using JSTL in
combination with resource bundles. Resource bundles are
properties files which contain key-value pairs
10 What is the use of <c:if> tag?
The <c:if> tag evaluates an expression and displays its body content only if the expression evaluates to
true.
11 Which of the following is the correct order of servlet life cycle phase
methods?
- init, service, destroy
12 Which of the following is true about javax.servlet.error.request_uri?
This attribute gives information about URL calling the servlet and it can be stored
and analysed after storing in a java.lang.String data type.
This attribute gives information about URL calling the servlet and it can be stored
and analysed after storing in a java.lang.String data type.
13.Which of the following code is used to get locale in servlets?
Ans. :request.getlocale
14.Which of the following method can be used to get complete list of all
parameters in the current request?
request.getParameterNames
15.Which of the following code can be used to set the locale of the response?
Ans.: header.setLocale
16 Which of the following code is used to get locale in servlets?
Ans.: request.getlocale
17 Which built-in method removes the last element from an array and returns that
element?
Ans.: Array.prototype.pop()
18.Which of the following code is used to get names of the attributes in servlet?
request.getAttributeNames()
19.JSP FULL FORM?
Jakarta Server Pages (JSP; formerly JavaServer Pages)
20.Java Script is product of Oracle? Ans.: Yes.
21.How many jsp implicit objects are there and these objects are created by the
web container that are available to all the jsp pages?
Ans.: 9
22.In JSP Action tags which tags are used for bean development?
Ans.: jsp:useBean, jsp:setPoperty and jsp:getProperty
23.In JSP page directive which attribute defines the MIME(Multipurpose Internet
Mail Extension) type of the HTTP response?
Ans.: Content Type
24.Which packages does a JSP API consist of? Ans.: javax.servlet.jsp,
javax.servlet.jsp.tagext
25.To Compile Servlet which jar file require for Tomcat Apache Server?
Ans.: Servlet-API.jar
26.Which class can handle any type of Request means protocol independent?
Ans. GenericServlets
27.Which object is created by the Web Contained at time of Deploying the
project.
Ans. ServletContext
28.Which method is used to send the same request and response objects to
another servlet using Request Dispatcher?
Ans.: forward()
29.A Deployment Descriptor Describes _________________
Ans.: Web Component Setting
30.Which tag is used to pass parameter for particular Servlet using web.xml?
Ans. <init-param>
31.What is the original name of JavaScript? Ans.: Mocha
32.What is the syntax for referring to an external script called “vbit.js”?
Ans.: <script src=”vbit.js”>
33.What are the types of Pop up boxes available in Javascript?
Ans.: Alert(), prompt() and confirm()
34.How to get a particular value using the tagged name?
Ans.:getElementsbyTagName()
35.If para1 is the DOM object for a paragraph, what is the correct syntax to
change the text within the paragraph?
Ans.: para1.value=”New Text”