Computer Associates Placement Paper (Technical-J2EE, JSP)




1. What exception is thrown when Servlet initialization fails (a) IOException

(b) ServletException

(c) RemoteException


ANS (b)


2. How can a Servlet call a JSP error page


(a) This capability is not supported.

(b) When the servlet throws the exception, it will automatically be caught by the calling JSP page.

(c) The servlet needs to forward the request to the specific error page URL. The exception is passed along as an attribute named javax.servlet.jsp.jspException.

(d) The servlet needs to redirect the response to the specific error page, saving the exception off in a cookie.


ANS (c)


3. What is the key difference between using a jspforward and HttpServletResponse.sendRedirect()


(a) forward executes on the client while sendRedirect() executes on the server.

(b) forward executes on the server while sendRedirect() executes on the client.

(c) The two methods perform identically.


ANS (b)


4. Why beans are used in J2EE architecture in stead of writing all the code in JSPs


(a) Allows separation of roles between web developers and application developers

(b) Allows integration with Content Management tools


ANS (a)


5. Why DB connections are not written directly in JSPs


(a) Response is slow

(b) Not a standard J2EE architecture

(c) Load Balancing is not possible

(d) All the above

(e) Both (b) and (c)


6. How multiple EJB instances are managed


(a) Connection Pooling

(b) Caching of EJB instances

(c) EJB Passivation

(d) All the above


ANS I think answer is (d)


7. At what stage, the life cycle of a CMP bean can be assumed to be started


(a) before ejbCreate() method is executed

(b) after ejbCreate() method is executed

(c) in postCreate() method

(d) after executing ejbStore()


8. Lot of Questions on EJB Transactions and how to manage them.


9. In JSP, how can you know what HTTP method (GET or POST) is used by client request


(a) by using request.getMethod()

(b) by using request.setMethod()

(c) impossible to know


ANS (a)


10. What is legal about JSP scriplets


(a) A loop can begin in one Scriptlet and end in another

(b) Statements in Scriptlets should follow Java Syntax

(c) Semicolon is needed at the end of each statement in a Scriptlet

(d) All the above


ANS (d)


11. Which method is called first each time a Servlet is invoked


(a) Start()

(b) Run()

(c) Servive()

(d) init()


ANS (d)


12. The time between Command Execution and Response is called ______


(a) Granularity

(b) Latency

(c) Lag time


ANS (c)





Latency is a measure of the temporal delay. Typically, in xDSL, latency refers to the delay in time between the sending of a unit of data at the originating end of a connection and the reception of that unit at the destination end.

In a computer system, latency is often used to mean any delay or waiting that increases real or perceived response time beyond the response time desired. Within a computer, latency can be removed or hidden by such techniques as prefetching (anticipating the need for data input requests) and multithreading, or using parallelism across multiple execution threads.

In networking, the amount of time it takes a packet to travel from source to destination. Together, latency and bandwidth define the speed and capacity of a network.



The extent to which a system contains separate components (like granules). The more components in a system -- or the greater the granularity -- the more flexible it is.

Granularity is a term often used in parallel processing to indicate independent processes that could be distributed to multiple CPUs. Fine granularity is illustrated by execution of statements or small loop iterations as separate processes; coarse granularity involves subroutines or sets of subroutines as separate processes. The more processes, the finer the granularity and the more overhead required to keep track of them. Granularity can also be related to the temporal duration of a task at work. It is not only the number of processes but also how much work each process does, relative to the time of synchronization, that determines the overhead and reduces speedup figures.


Lag Time

Lag Time is the amount of time between making an online request or command and receiving a response. A primary goal of advertising network efficiency is to minimize lag time.


13. 2 Questions on RMI and EJB related (I don't reemember them)


14. Purpose of jspplugin tag


(a) used to incorporate Java applets into a Web page.

(b) Downloads a plugin to the client Web browser to execute an applet or Bean.

(c) Both (a) & (b)


ANS (c)




JSP Syntax






[ name=instanceName ]

[ archive=URIToArchive, ... ]

[ align=bottomtopmiddleleftright ]

[ height=displayPixels ]

[ width=displayPixels ]

[ hspace=leftRightPixels ]

[ vspace=topBottomPixels ]

[ jreversion=JREVersionNumber 1.1 ]

[ nspluginurl=URLToPlugin ]

[ iepluginurl=URLToPlugin ]


[ jspparams

[ jspparam name=parameterName value=parameterValue ]+

jspparams ]


[ jspfallback text message for user jspfallback ]