Which statement among the following apply to redirecting a HTTP request to another URL?
Correct Answer:
The redirect method must be called before the response body is committed, otherwise an IllegalStateException is thrown
Note: This Question is unanswered, help us to find answer for this one
How do you create the Parameter buttons the toolbar for component com_hello?
Correct Answer:
JToolBarHelper::preferences('com_hello', '500');
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods must you use to deny access from an external direct call?
Correct Answer:
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.')
Note: This Question is unanswered, help us to find answer for this one
What is the role of the template metadata file in the system?
Correct Answer:
All of these.
Note: This Question is unanswered, help us to find answer for this one
Why does Joomla use templateDetails.xml files?
Correct Answer:
To provide information and allow selection of the template within the template manager;
Note: This Question is unanswered, help us to find answer for this one
From which package are the classes (i.e JSite, JAdministrator and JInstallation) which make up the Joomla CMS application extended?
Correct Answer:
Installer
Note: This Question is unanswered, help us to find answer for this one
Which interface and method name should be used to retrieve HTTP request header information?
Correct Answer:
HttpServletRequest.getHeaderNames
Note: This Question is unanswered, help us to find answer for this one
Assume the custom tag is GLOOP and the prefix is TWONG. Which of the following is the syntax for an empty custom tag?
Correct Answer:
TWONG:GLOOP/>
Note: This Question is unanswered, help us to find answer for this one
How would you use a bean in a JSP page?
Correct Answer:
<jsp:useBean id="houseLotBean" scope="session" class="session.Realestate"/>
Note: This Question is unanswered, help us to find answer for this one
Which of the following options is a valid declaration?
Correct Answer:
<%! String name="Patricia"; %>
Note: This Question is unanswered, help us to find answer for this one
Assuming the tag library is in place and the tag handler is correct, which of the following is the correct way to use a custom tag in a JSP page?
Correct Answer:
<yourLibrary:whatColorlslt color="red"/>
Note: This Question is unanswered, help us to find answer for this one
What is the WebApp deployment descriptor element name for the Servlet Context Initialization Parameters?
Correct Answer:
<context-param>
Note: This Question is unanswered, help us to find answer for this one
Consider the following statement:
PreparedStatement ps=con.prepareStatement("INSERT INTO ORDER (CUSTOMER_ID ,PRICE) VALUES(?,?)");
Which of the following should come after this statement?
Correct Answer:
ps.clearParameters(); ps.setInt(1,3); ps.setDouble(2,790.50); ps.executeUpdate();
Note: This Question is unanswered, help us to find answer for this one
After executing the following code, resultvar contains false. What should the next step be?
boolean resultvar=stmt.execute(sql);
Correct Answer:
stmt.executeUpdate();
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not a JSP implicit object?
Correct Answer:
in
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are true regarding the structure of a WebArchive file?
Correct Answer:
It is a JAR archive of the WebApplication structure
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are true regarding the HTTP GET method?
Correct Answer:
There is a limit on how much data this HTTP method can send
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are best associated with the HTTPPOST method?
Correct Answer:
There is no limit on how much data this HTTP method can send
Note: This Question is unanswered, help us to find answer for this one
Which interface and method name should be used to acquire a text stream for the response?
Correct Answer:
ServletResponse.getWriter
Note: This Question is unanswered, help us to find answer for this one
With regard to the servletcontextlistener interface, which of the following methods is valid?
Correct Answer:
contextInitialized
Note: This Question is unanswered, help us to find answer for this one
Which statement is true regarding ServletContext Initialization Parameters in the deployment descriptor?
Correct Answer:
They are accessible by all servlets in a given web application
Note: This Question is unanswered, help us to find answer for this one
With regard to the destroy lifecycle method, identify the correct statements about its purpose or about how and when it is invoked.
Correct Answer:
It gives the servlet an opportunity to clean up resources
Note: This Question is unanswered, help us to find answer for this one
Read the following code snippet:
1 <libraryPrefix:handlerName parameterNAme="value">
2 <%=23*counter %>
3 <b>Congratulations!</b>
Which of the following is the correct way to complete the above code snippet?
Correct Answer:
</libraryPrefix:handlerName>
Note: This Question is unanswered, help us to find answer for this one
Which design pattern did technical designers of JSP use to provide centralized dispatching of requests via a controller servlet?
Correct Answer:
Model-view-Controller
Note: This Question is unanswered, help us to find answer for this one
Which method is called by the servlet container just after the servlet is removed from service?
Correct Answer:
public void destroy() {// code...}
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the listener interface for servlet context attributes?
Correct Answer:
ServletContextAttributeListener
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a JSP implicit object?
Correct Answer:
request
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the name of the cookie used by Servlet Containers to maintain
session information?
Correct Answer:
JSESSIONID
Note: This Question is unanswered, help us to find answer for this one
Which design pattern reduces network traffic by acting as a caching proxy of a remote object?
Correct Answer:
Value Object
Note: This Question is unanswered, help us to find answer for this one
Which design pattern is used to decouple presentation from core data access functionality?
Correct Answer:
ModelView Controller
Note: This Question is unanswered, help us to find answer for this one
With regard to the service() lifecycle method, identify two correct statements about its purpose or about how and when it is invoked.
Correct Answer:
It is called whenever the servlet is requested
Note: This Question is unanswered, help us to find answer for this one
Which of the following are used by Servlet Containers to maintain session information?
Correct Answer:
Cookies
Note: This Question is unanswered, help us to find answer for this one
Which JSP action retrieves the value of a property from a properly declared JavaBean in a JSP page?
Correct Answer:
jsp:getProperty
Note: This Question is unanswered, help us to find answer for this one
If cookies are turned off on the client, which two methods still work with the session ID?
Correct Answer:
encodeRedirectURL()
Note: This Question is unanswered, help us to find answer for this one
What output will be sent to the browser by the following code snippet?
<!—
Que <%="Reader"%>
-->
Correct Answer:
'Que Reader' within HTML comment markers
Note: This Question is unanswered, help us to find answer for this one
What does the container do with the following code snippet?
<!--#include file="somefile.html"-->
Correct Answer:
The container passes this line of code through to the client
Note: This Question is unanswered, help us to find answer for this one
Assuming the servlet method for handling HTTPGET requests is doGet(HttpServletRequest req, HTTPServletResponse res), how do you get a request parameter in that servlet?
Correct Answer:
String value=req.getParameter("product");
Note: This Question is unanswered, help us to find answer for this one
Which method in the HttpServlet class corresponds to the HTTPPUT method?
Correct Answer:
doPut
Note: This Question is unanswered, help us to find answer for this one
Which interface provides access to request scoped attributes?
Correct Answer:
ServletRequest
Note: This Question is unanswered, help us to find answer for this one
What is Template Data?
Correct Answer:
The taglib XML namespace
Note: This Question is unanswered, help us to find answer for this one
Which of the following options is a valid expression?
Correct Answer:
<%=(new java.util.Date()).toLocaleString() %>
Note: This Question is unanswered, help us to find answer for this one
Suppose you had a servlet that simply returned an error message because that resource was forbidden to that user. Read the following code snippet:
1.public void service(HttpServletRequestrequest,
2.HttpServletResponseresponse)
3.throws ServletException, IOException
4. {
5.
6. }
What code would you type on line 5 to return an error message to the requesting client?
Correct Answer:
response.sendError(HTTPServletResponse.SC_FORBIDDEN,"Error");
Note: This Question is unanswered, help us to find answer for this one
What is the file name of the WebApp deployment descriptor?
Correct Answer:
web.xml
Note: This Question is unanswered, help us to find answer for this one
Which statement is true regarding a servlet context listener?
Correct Answer:
An object that implements a context listener is notified when its Web App context is created or destroyed
Note: This Question is unanswered, help us to find answer for this one
Which among the following objects is the best choice to share information between pages for a single user?
Correct Answer:
session
Note: This Question is unanswered, help us to find answer for this one
Read the following code snippet and answer the question based upon it:
<taglib>
<taglib-uri>
http://www.yourcompany.com/you TagLibrary
</taglib-uri>
<taglib-location>
/WEB-INF/yourTagLibrary.tld
</taglib-location>
</taglib>
From the statements given below, which one applies to the code snippet?
Correct Answer:
The taglib directive can reference a TLD by name
Note: This Question is unanswered, help us to find answer for this one
Which method in the HttpServlet class corresponds to the HTTPPOST method?
Correct Answer:
doPost
Note: This Question is unanswered, help us to find answer for this one
Which of following interfaces can make a servlet thread safe?
Correct Answer:
SingleThreadModel
Note: This Question is unanswered, help us to find answer for this one
In which directory do you place servlet class files?
Correct Answer:
WEB-INF\classes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Servlets can't be made thread safe<br>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
POST method sends data in the body of the request
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NullPointerException
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
In their respective DD tags, they both have a <param-name> and a <param-value> tag
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Each time doPost() is invoked, it runs in its own thread
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Invoke a Servlet from a JSP page.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%@ page isThreadSafe=
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Servlet
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
tag-attributes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
2k
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
In the body of a tag where body-content is set to JSP
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
application
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
response
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
2
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Controls properties of the JSP
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
1 and 3
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
javax.servlet.ServletContext
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The same operation applied multiple times yields the same result
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The servlet won’t compile
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
java.lang.Throwable
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jspInit()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An empty Enumeration object is returned
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JspWriter
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
TRACE
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
This is an invalid usage of @WebServlet annotations because of the wrongly formed url-pattern value
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
cookie
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
a only
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
3
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
session
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
HTML
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
getServletConfig
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
HttpServletRequest
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
implements
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
java.io.PrintWriter
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jar
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
_jspService() method
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
context
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It has no abstract methods
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It indicates whether the content output from the page will be buffered
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
3
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
a and c
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%= some-java-expression %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
pageContext
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Invoking req.getSession(true) will return a new session
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<% Java statements %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jsp-config
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jsp:plugin
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Java Server Pages Standard Library
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
JSP
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
config
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%@ page import="java.util.*"%>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jspDestroy()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
tries to find an object, creates it if it does not exist
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both taglib-uri and taglib-location
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
config
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jsp:forward
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
not included
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException{
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jspInit()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Cookies, hidden fields, URL rewrite.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Request Scope
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
see if the page needs to be compiled
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
By default it is a GET request
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
web.xml
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
session and Cookies
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
a compatible web server with a servlet container
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<sql:update> </sql:update>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%@ page %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
POST
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Both ServletRequest & ServletResponse
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
web.xml
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Once a connection is open then closed, the web server doesn't recognize the request or any past requests.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%@ taglib prefix="c" uri="http..." %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
String var_str = "this";
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
// comment
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
web.xml
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
if(x == 1) { }
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
HTTP
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Date myDate = new Date();
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
if () { }
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%@ page import="java.text.*" %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
try { } catch () { }
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
the server
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%@ page import="java.io.*" %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Java
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Tomcat
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
out.println();
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<% java code %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Servlet
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
<%= expression %>
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Java Server Pages
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
jsp:setSession
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Only once in the life time
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The value of s cannot be guaranteed
Note: This Question is unanswered, help us to find answer for this one
JSP And Servlets MCQs | Topic-wise