Java Server Pages - Advanced Java Test
1) JavaServer Pages often serve the same purpose as programs implemented using the Common Gateway Interface (CGI)?
A) True
B) False
View Answer / Hide Answer2) In JSP which can generate HTML dynamically on the client but can hardly interact with the web server to perform complex tasks like database access and image processing etc.?
A) vs.Static HTML
B) vs.Server-Side Includes
C) vs.Pure Servlets
D) Vs.JavaScript
View Answer / Hide Answer3) A JSP page consists of which tags?
A) HTML tags
B) JSP tags
C) Both A & B
D) None of the above
View Answer / Hide Answer4) These are the advantages of which technology, Extension to Servlet Easy to maintain; No need to recompile and redeploy Fast Development Less code?
A) JSP
B) Servlet
C) Both A & B
D) None of the above
View Answer / Hide Answer5) In which technology, we mix our business logic with the presentation logic?
A) Servlet
B) JSP
C) Both A & B
D) None of the above
View Answer / Hide Answer6) In the following which packages does a JSP API consists of?
A) javax.servlet.jsp
B) java.servlet
C) javax.servlet.jsp.tagext
D) Both A & C
View Answer / Hide Answer7) The javax.servlet.jsp package has two interfaces find in the following?
A) JspPage
B) HttpJspPage
C) JspWriter
D) PageContext
E) Both A & B
View Answer / Hide Answer8) 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
View Answer / Hide Answer9) How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?
A) 8
B) 9
C) 10
D) 7
View Answer / Hide Answer10) In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?
A) import
B) Content Type
C) Extends
D) Info
View Answer / Hide Answer11) The Jsp include directive is used to include the contents of any resource it may be?
A) jsp file
B) html file
C) text file
D) All mentioned above
View Answer / Hide AnswerANSWER: D) All mentioned above
12) In JSP how many ways are there to perform exception handling?
A) 3
B) 2
C) 4
D) 5
View Answer / Hide Answer13) In JSP Action tags which tags are used for bean development?
A) jsp:useBean
B) jsp:setPoperty
C) jsp:getProperty
D) All mentioned above
View Answer / Hide AnswerANSWER: D) All mentioned above
14) In JSP Action tags which is used to include the content of another resource it may be jsp, html or servlet?
A) jsp:include
B) jsp:forward
C) jsp:plugin
D) jsp:papam
View Answer / Hide Answer15) A bean encapsulates many objects into one object, so we can access this object from multiple places?
A) True
B) False
View Answer / Hide Answer16) In JSP action tags Which are used for developing web application with Java Bean?
A) jsp:useBean
B) jsp:setProperty
C) jsp:getProperty
D) Both B & C
View Answer / Hide Answer17) Model View Controller in JSP which represents the state of the application i.e. data. It can also have business logic?
A) Model
B) View
C) Controller
D) None of the above
View Answer / Hide Answer18) Seperation of business logic from JSP this is the advantage of?
A) Custom Tags in JSP
B) JSP Standard Tag Library
C) Both A & B
D) None of the above
View Answer / Hide AnswerANSWER: A) Custom Tags in JSP
19) In which Architecture of a JSP Application JSP plays a key role and it is responsible for processing the request made by client?
A) Model1 Architecture
B) Model2 Architecture
C) Both A & B
D) None of the above
View Answer / Hide AnswerANSWER: A) Model1 Architecture
20) Which Error Handling in Java handles runtime errors with exceptions, If an exception is not caught in your JSP or Servlet,Resin will use a special error page to send results back to the browser,Resin uses a default error page unless you explicitly provide an error page yourself?
A) Client Request Time Processing Errors
B) Compilation Time Processing Errors
C) JSP Translation Time Processing Errors
D) None of the above
View Answer / Hide AnswerANSWER: A) Client Request Time Processing Errors
21) JSPs eventually are compiled into Java servlets, you can do as much with JSPs as you can do with Java servlets?
A) True
B) False
View Answer / Hide Answer22) Which is the Microsoft solution for providing dynamic Web content?
A) ASP
B) JSP
C) Both A & B
D) None of the above
View Answer / Hide Answer23) In which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
A) The ErrorPage Attribute
B) The IsErrorPage Attribute
C) Both A & B
D) None of the above
View Answer / Hide AnswerANSWER: A) The ErrorPage Attribute
24) In JSP which is an exception that is typically a user error or a problem that cannot be foreseen by the programmer?
A) Checked exceptions
B) Runtime exceptions
C) Errors
D) None of the above
View Answer / Hide AnswerANSWER: A) Checked exceptions
25) The authentication mechanism in the servlet specification uses a technique called?
A) Role Based Authentication
B) Form Based Authentication
C) Both A & B
D) None of the above
View Answer / Hide AnswerANSWER: A) Role Based Authentication
26) JSP’s provide better facilities for separation of page code and template data by mean of Java beans, EJBs and custom tag libraries?
A) True
B) False
View Answer / Hide Answer27) The ASP and JSP technologies are quite similar in the way they support the creation of Dynamic pages, using HTML templates, scripting code and components for business logic?
A) True
B) False
View Answer / Hide Answer