0% found this document useful (0 votes)
54 views

Java Script QA

The document contains 15 multiple choice questions about Java Server Pages (JSP) technology. Some key points covered include: - The session object is an instance of the HttpSession class. - JSP action tags like <jsp:useBean>, <jsp:setProperty>, and <jsp:getProperty> are used for bean development. - The <jsp:include> action tag is used to include the content of another resource like a JSP, HTML or servlet file. - Common implicit objects in JSP include page, pageContext, request, response, session, application, config, out and exception. - The responseWriter implicit object is associated with the output stream of the response

Uploaded by

asdf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Java Script QA

The document contains 15 multiple choice questions about Java Server Pages (JSP) technology. Some key points covered include: - The session object is an instance of the HttpSession class. - JSP action tags like <jsp:useBean>, <jsp:setProperty>, and <jsp:getProperty> are used for bean development. - The <jsp:include> action tag is used to include the content of another resource like a JSP, HTML or servlet file. - Common implicit objects in JSP include page, pageContext, request, response, session, application, config, out and exception. - The responseWriter implicit object is associated with the output stream of the response

Uploaded by

asdf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Q1.

The major security problem with cookies is that they ____


do not require any server resources
are easy to implement
anyone can open and interfere with cookies
Correct Answer
can exist for a specified length of time

Q2.
Which of the following tasks are performed with client side programs? 1. Create interactive
webpage. 2. Managing all operations on database 3. Asking the browser to display information 4.
Making the Web page fit to purpose depending on the browser and browser features
Only i
Only ii
i,ii,iii & iv
i,iii & iv
Correct Answer

Q3.
Which of the following are structural elements of HTTP request
Message Body
Request Headers
General Headers
All the above
Correct Answer

Q4.
The statement open (FH,”abc.txt”);
opens the file abc.txt for overwriting
opens the file abc.txt for reading
Correct Answer
contains an error, so won’t compile
opens the file abc.txt for appending

Q5.
If you are connected to internet, then your computer has a unique____
electronic address
postal address
IP address
Correct Answer
None of the above
Q6.
Which of the below are CSS Types?
Internal Stylesheet
External Stylesheet
Both A & B
Correct Answer
None of the above

Q7.
What is Perl?
Practical Extraction and Report Language
Correct Answer
Practice for Exclusive and Report Language
Practical Extraction and Report Learning
Practical Exclusive and Report Language

Q8.
Style rule consist of which of the following elements
Selector
Property
Value
All of the above
Correct Answer

Q9.
HTTP stands for:
Hypertext Transfer Protocol
Correct Answer
Hypertext Transport Protocol
Hyper Transport Protocol
None of the above

Q10.
CSS stands for
Cascading Style Sheets
Correct Answer
Control Style Sheets
Calculated Style Sheet
Controlled Style Sheets

Q11.
Which of the following data types are preceded by a dollar sign ($) in Perl?
Scalar
Correct Answer
Array
Hashes
All the above

Q12.
In the context of Internet programming, what does CGI stand for ?
Crappy Graphics Interface
Computer Generated Images.
Common Gateway Interface.
Correct Answer
Calculated Graphical Integration

Q13.
The communication protocol used by Internet is
HTTP
WWW
TCP/IP
Correct Answer
FTP

Q14.
Which HTML tag is used to make text bold?
<br>
<b>
Correct Answer
<u>
<i>

Q15.
Which of the following attribute is used to CREATE, WRITE,TRUNCATE a file?
< file
> file
Correct Answer
+< file
>>file

Q1.
In Apache Tomcat ,the ___ directory is where Web applications live
temp
lib
webapps
Correct Answer
bin

Q2.
Which of the following is not an example of web server?
Microsoft IIS
Jigsaw
Ubuntu
Correct Answer
Apache web server

Q3.
Which of the below file contains the security policy statements that are implemented by the Java
SecurityManager.
server.xml
context.xml
catalina.policy
Correct Answer
tomcat-users.xml

Q4.
In Apache Tomcat catalina.sh script resides in which of the below tomcat directory?
/bin
Correct Answer
/conf
/work
/lib

Q5.
Lib directory of Apache Tomcat includes___
Tomcat JARs
Servlet API
JSP API
All of these
Correct Answer

Q6.
Which file can be used to define Apache Tomcat specific configuration options
/META-INF/conf.xml
/META-INF/lib/context.xml
/META-INF/classes/context.xml
/META-INF/context.xml
Correct Answer

Q7.
Installation of Apache Tomcat requires___
Java Virtual Machine
Correct Answer
Virtual Machine
Both A & B
None of the above

Q8.
How can logging be done by a web application running on Apache Tomcat?
Use the logging API provided by the Java Servlets Specification
Use system logging API
Use any logging framework
All of these
Correct Answer

Q9.
In Apache Tomcat server.xml resides in which of the below tomcat directory?
/bin
/conf
Correct Answer
/work
/lib

Q10.
Where does the Web Application Deployment Descriptor for application be placed as per the
Servlet API Specification
/WEB-INF/wdd.xml
/WEB-INF/lib/web.xml
/WEB-INF/classes/web.xml
/WEB-INF/web.xml
Correct Answer

Q11.
Which of the following file of Apache Tomcat is used to set up where to access the web.xml file in
Web applications?
catalina.policy
context.xml
Correct Answer
server.xml
tomcat-users.xml

Q12.
In Apache Tomcat where does the web.xml file should be saved?
webapps
META-INF
WEB-INF
Correct Answer
In any directory

Q13.
Manifest file has ___ extension
.mf
Correct Answer
.jar
.java
.jsp

Q14.
Which of the below are attributes of engine element?
backgroundProcessDelay
className
defaultHost
All of these
Correct Answer

Q15.
SSL is a protocol that provides security for communications between client & server
Secure Socket Layer
Correct Answer
Security Socket Layer
Secure Servlet Layer
None of the above

Q1.
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
Correct Answer
URL rewriting, using servlet object, using response object, using cookies
URL rewriting, using request object, using response object, using session object
Q2.
In HTTP Request what asks for the loopback of the request message, for debugging or for
troubleshooting?
PUT
OPTIONS
DELETE
TRACE
Correct Answer

Q3.
_________ is responsible for managing execution of servlet
Web Container
Correct Answer
Servlet Context
JVM
Server

Q4.
Which of these classes define the getWriter() method that returns an object of type PrintWriter ?
HttpServletRequest
HttpServletResponse
Correct Answer
ServletConfig
ServletContext

Q5.
Which methods are used to bind the objects on HttpSession instance and get the objects?
setAttribute
getAttribute
Both A & B
None of the above
Correct Answer

Q6.
____________ object is available to any servlet or JSPs that are part of the web app and provides
communication between servlets and JSPs.
Servlet
ServletConfig
ServletContext
Correct Answer
HttpServletContext
Q7.
When using HTML forms which of the following is `TRUE for POST method ? Select the one
correct answer.
POST allows users to bookmark URLs with parameters.
The POST method should not be used when large amount of data needs to be transferred.
POST method shows the send data in the URL.
POST method sends data in the body of the request.
Correct Answer

Q8.
Which packages represent interfaces and classes for servlet API?
javax.servlet
javax.servlet.http
Both A & B
Correct Answer
None of the above

Q9.
Which methods are used to bind the objects on HttpSession instance and get the objects?
setAttribute
getAttribute
Both A & B
Correct Answer
None of the abov

Q10.
Which method is called only once in Servlet life cycle ?
service()
init()
Correct Answer
initialize()
All of the above

Q11.
Whose object is passed to init method of Servlet?
ServletConfig
Correct Answer
ServletContext
PageContext
ServletRequest

Q12.
Which method defined in the HttpServletResponse may be used to set the content type ?
setType()
setContent()
setContentType()
Correct Answer
setResponseContentType()

Q13.
Which method in session tracking is used in a bit of information that is sent by a web server to a
browser and which can later be read back from that browser?
HttpSession
URL rewriting
Cookies
Correct Answer
Hidden form fields

Q14.
Which class can handle any type of request so that it is protocol-independent?
GenericServlet
Correct Answer
HttpServlet
Both A & B
None of the above

Q15.
When the Web Container initializes a servlet, it creates a ___________ object for the servlet ?
ServletConfig
Correct Answer
ServletInit
ServletContext
None of the above

Q1.
Which of the following Standard action code dispatch the request to another JSP Pages?
<jsp:forward page="view.jsp"/>
Correct Answer
<jsp:forward file="view.jsp"/>
<jsp:dispatch page="view.jsp"/>
<jsp:dispatch file="view.jsp"/>

Q2.
session is instance of which class?
Session
HttpSession
Correct Answer
HttpServletSession
ServletSession

Q3.
In JSP Action tags which tags are used for bean development?
jsp:useBean
jsp:setPoperty
jsp:getProperty
All mentioned above
Correct Answer

Q4.
Which JSP Action tags is used to include the content of another resource, it may be jsp, html or
servlet?
jsp:include
Correct Answer
jsp:forward
jsp:plugin
jsp:papam

Q5.
Which of the following are attributes for taglib directive<%@taglib%>?
uri, suffix
URL, suffix
uri, prefix
Correct Answer
url, prefix

Q6.
Which implicit object of JSP is equivalent to this variable of Java programming language?
page
Correct Answer
pageContext
config
application

Q7.
Which is not a valid JSP Implicit Object?
exception
session
context
Correct Answer
pageContext

Q8.
Choose the correct syntax of include directive?
<%@ include page="file.jsp" %>
<% include file="file.jsp" %>
<%@ include file="file.jsp" %>
Correct Answer
<%! include page="file.jsp" %>

Q9.
Which implicit object is only available to a JSP page which is designated as error pages?
application
throwable
runnable
exception
Correct Answer

Q10.
What is output of following? <%session.setAttribute("name","JSP"%> <%=getAttribute("name"%>
JSP
Correct Answer
name
null
None of the above

Q11.
Which of the following is not a method of Session Object?
isNew()
getServerInfo()
Correct Answer
invalidate()
getAttribute(String)

Q12.
A JSP page consists of which tags?
HTML tags
JSP tags
Both A & B
Correct Answer
None of the above

Q13.
Which Standard tag is used store data in the JavaBeans instance?
<jsp:useBean>
<jsp:setBean>
<jsp:setProperty>
Correct Answer
<jsp:set>

Q14.
Which attribute specifies a JSP page that should process any exceptions thrown but not caught in
the current page?
The ErrorPage Attribute
Correct Answer
The IsErrorPage Attribute
Both A & B
None of the above

Q15.
Which implicit object of JSP is associated with the Output Stream of response object?
write
out
Correct Answer
response
responseWriter

Q1.
Which are different points where weaving can be applied?
compile time,classload time
compile time & runtime
compile time, load time, runtime.
Correct Answer
compile time, classload time, runtime.

Q2.
Beans defined in Spring Framework are by default
singleton
Correct Answer
non-singleton
Both A & B
None of the above

Q3.
Spring Provides
Resource Management
Exception Handling
Transaction Participation
All of the above
Correct Answer

Q4.
IOC or Dependent Injection is a
Framework
Design pattern
Correct Answer
Java Module
ORM Framework

Q5.
What is ORM
object/relational mapping
It is automated persistence of objects in a java application to tables in a relational tables
Both of above
Correct Answer
None of the above

Q6.
An ___________ tag can hold any Java language expression that can be used as an argument to
out.println() method.
Expression tag
Correct Answer
Declaration Tag
Directive Tag
Scriptlet Tag

Q7.
Which of the following is syntax of Expression Tag?
<% Expression %>
<%= Expression %>
Correct Answer
<%= Expression =%>
<%@ Expression %>
Q8.
Not a Spring module
AOP
O/R integration
Spring MVC
HTML/JSP
Correct Answer

Q9.
Which of the following is `TRUE about autoFlush attribute?
autoFlush attribute can specify that buffered output should be flushed automatically when the buffer
is filled
autoFlush attribute can specify that an exception should be raised to indicate buffer overflow
Both A & B are correct
Correct Answer
None of the above

Q10.
IOC stands for
Inversion of Controller
Inversion of Control
Correct Answer
Intake of Control
Invitation of control

Q11.
response is instance of which class?
Response
HttpResponse
HttpServletResponse
Correct Answer
ServletResponse

Q12.
AOP stands for
Application oriented programmin
Aspect Oriented Programming
Correct Answer
Both A & B
None of the above
Q13.
Which are the states of session?
transient
detached
Both A & B
Correct Answer
None of the above

Q14.
Hibernate consists of component
Entities
Object-relational metadata
Hibernate Query Language
All of the above
Correct Answer

Q15.
Which of the below are methods of session interface?
cancelQuery
beginTransaction
close
All of the above
Correct Answer

Q1.
What data access technology is not supported by the Spring Framework?
JDBC
NoSQL
Correct Answer
Hibernate
JPA

Q2.
Considering Spring Which of the following is not `TRUE?
Central to Spring Framework is IOC Container
IOC provides a consistent means of Configuring & managing Java Objects using call backs
IOC container is responsible for managing object lifecycle.
All of the above
Correct Answer

Q3.
Which of the looping statements is/are supported by PHP? i) for loop ii) while loop iii) do-while
loop iv) foreach loop
(i) and (ii)
(i), (ii) and (iii)
All of the above
Correct Answer
None of the above

Q4.
MVC stands for
Middle View Controller
Module View Controller
Model View Controller
Correct Answer
None of the above

Q5.
PHP uses which one of the following function to start a session?
start_session()
session_start()
Correct Answer
session_begin()
begin_session()

Q6.
What will be the output of the following php code? < ?php $num = "1"; $num1 = "2"; print $num+
$num1 ; ?>
3
Correct Answer
1+2
Error
12

Q7.
Which of the following php statement/statements will store 111 in variable num in PHP? i) int $num
= 111; ii) int num = 111; iii) $num = 111; iv) 111 = $num;
Both (i) and (ii)
All of the mentioned
Only (iii)
Correct Answer
Only (i)

Q8.
Which of the following is/are a PHP code editor?
Notepad
Notepad++
Adobe Dreamweaver
All of the above
Correct Answer

Q9.
AOP implementations in Spring are provided by which of the below option?
AspectJ
SpringAOP
Jboss AOP
All of the above
Correct Answer

Q10.
What is a pointcut?
code to execute at a join Point
An expression to identify jointpoints
Correct Answer
An advice & a jointpoint
None of the above

Q11.
What will be the output of the following php code <?php $num = 1; $num1 = 2; print $num . "+".
$num1 ; ?>
3
1+2
Correct Answer
1.+2.
Error

Q12.
We can use ___ to comment a single line in PHP? i) /? ii) // iii) # iv) /* */
Only (ii)
(i), (iii) and (iv)
(ii), (iii) and (iv)
Correct Answer
Both (ii) and (iv)

Q13.
What does PHP stand for? i. Personal Home Page ii. Hypertext Preprocessor iii. Pretext Hypertext
Processor iv. Preprocessor Home Page
Both (i) and (ii)
Correct Answer
Both (ii) and (iv)
Only (ii)
Both (i) and (iii)

Q14.
What is an advice?
An action taken by an aspect at a particular join point
Correct Answer
A point during the execution of a program
An aspect and pointcut
a predicate that matches join point

Q15.
PHP files have a default file extension of
.html
.xml
.php
Correct Answer
.ph

Q1.
Calculations & Navigation should be considered for which point?
Correctness
Correct Answer
Reliability
Performance
Security

Q2.
Which of the following is non functional testing for an e-commerce website?
People can buy goods
people can return faulty goods
security of system during transaction
1000 people can log into system at same time.
Correct Answe

Q3.
____is the means by which a user agent is able to to locate a constituent resource of a WP.
Locator
Correct Answer
user agent
Manifest
Web Resource

Q4.
____confirms the performance of an application with a agreed number of concurrent active users.
Stress
Concurrency
Correct Answer
Throughput
None of the above

Q5.
In PHP, whiich one of the following methods is responsible to execute a query on MySQL?
query()
mysqli_execquery()
mysqli_query()
Correct Answer
mysqli_exec(

Q6.
Prerequisites for Website Publishing are
Web development software
Internet Connection
Web Server
All of the above
Correct Answer

Q7.
To open a MySQLi connection in PHP, which function is used?
mysqli_open()
mysqli_connect()
Correct Answer
open()
open_mysqli()

Q8.
Which variable is used to collect form data sent with both the GET and POST methods?
$BOTH
$_BOTH
$REQUEST
$_REQUEST
Correct Answer
Q9.
Which of the below points should be considered while considering the security of the web
application?
Viruses
Access control
External intrusion
All the above
Correct Answer

Q10.
When you use the PHP's $_GET variable to collect data, the data is visible to
none
only you
everyone
Correct Answer
selected few

Q11.
___includes recovering lost transactions, recovering from loss of communications, and ensuring
that proper backups are made as a part of regular systems maintenance
Recoverability
Correct Answer
Usability
Correctness
Compatibility

Q12.
_____confirms the number of transactions to be processed by an application during a given period
of time
Stress
Concurrency
Throughput
Correct Answer
None of the above

Q13.
Which one of the following should not be used while sending passwords or other sensitive
information?
GET
Correct Answer
POST
REQUEST
NEXT
Q14.
In PHP, The session_start() function must appear.
after the html tag
after the body tag
before the body tag
before the html tag
Correct Answer

Q15.
A web-based application should be able to work rightly on a broad variety of system configurations
including operating systems, browsers, and hardware systems is considered in____
Recoverability
Compatibility
Correct Answer
Correctness
Usability

You might also like