Section 1

Preview this deck

B

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (44)

Section 1

(44 cards)

B

Front

Action <jsp: setProperty>has the ability to match request parameters to properties of the same name in a bean by specifying "*" for attribute property. A. False B. True

Back

B

Front

A JSP page called test.jsp is passed a parameter name in the URL using http://localhost/Final/test.jsp?name=John. The test.jsp contains the following code. <% String myName=request.getParameter("name");%> <% String test= "Welcome " + myName; %> <%=test%> What is the output? a. The page display "Welcome John" b. The program gives a syntax error because of the statement <% String myName=request.getParameter("name");%> c. The program gives a syntax error because of the statement <% String test= "Welcome " + myName; %> d. The program gives a syntax error because of the statement <%=test%>

Back

A

Front

A <servlet> element can include zero to many <init-param> elements: These aid in passing initialization parameter information from the deployment descriptor to all the servlets. A False B. True

Back

B

Front

Which of the following correctly represents the following JSP statement? Select one correct answer. <%=x%> A. <jsp:expression=x/> B. <jsp:expression>x</jsp:expression> C. <jsp:statement>x</jsp:statement> D. <jsp: declaration>x</jsp:declaration> E <jsp:scriptlet>x</jsp:scriptlet>

Back

B

Front

Study the statements. 1)The context path contains a special directory called WEB-INF, which contains the deployment descriptor file, web.xml. 2) A client application may directly access resources in WEB-INF or its subdirectories through HTTP. A. Both 1 and 2 are not true B. Only statement 1 is true C. Only statement 2 is true D. Both 1 and 2 are true

Back

C

Front

Study the statements: 1) URL rewriting may be used when a browser is disabled cookies. 2) In URL encoding the session id is included as part of the URL. Which is the correct option? A. Only statement 1 is true B. Only statement 2 is true C. Both 1 and 2 are true D. Both 1 and 2 are not true

Back

C

Front

Your web application logs a user in when she supplies username/password. At that time a session is created for the user. Your want to let the user to be logged in only for 20 minutes. The application should red........... A. getMaxinactivelnterval() B. getCreation Time() C. getLastAccessTime() D. getLastAccessedTime()

Back

D

Front

Which technique is likely to return an initialization parameter for a JSP page? A. <%= request.getParameter("myParm") %> B. <% String s = getAttributef'myParm"); %> C. <%= getParameter("myParm") %> D. <% String s = getInitParameter("myParm"); %> E. <% = application.getlnitParameter("myParm") %>

Back

A

Front

Consider the following tag declaration in a TLD file. <tag> <name>simpleinterest</name> <tag-class>SimpleInterestTag</tag-class> //1 </tag> SimpleinterestTag calculates simple interest for any amount and requires two attributes 'amount and 'rate'. Which of the following sub elements would you need to add inside the <tag> element in the TLD in place of //1 as shown above? Two separate <attribute> elements. A. One <attribute> element with sub-elements B. One <attribute-list element with sub-elements C. One <amount> element and one <rate> element

Back

B

Front

You have declared a useBean tag as: <jsp:useBean id="man" class="animal. Human" scope="application"/> in which type of object will this bean be kept? A. HttpSession B. Application Context C. ServletContext D. Servlet E. ServletConfig

Back

D

Front

What is output to the web page on the second access to the same instance of the following JSP? <html> <body <% int x = 0; %> <%= x++%> </body-> </html> A 3 B. 0 C. 1 D. 2

Back

B

Front

Which of the following statement correctly store an object associated with a name at a place where all the servlets/jsps of the same webapp participating in a session can access it? Assume that request, response, name, value etc. are references to objects of appropriate types.(Choose one) A request.setAttribute(name, value); B.request.getSession().setAttribute(name, value).; C. response.setAttribute(name, value); D. request.setParameter(name, value)

Back

b

Front

Which statement is true about the EJB 3.0 stateful session beans? A. Its conversational state is retained across method invocations but NOT across transaction boundaries B. Its conversational state is retained across method invocations and transactions C. Its conversational state is lost after passivation unless the bean class saves it to a database

Back

B

Front

Which of these is a correct fragment within the web-app element of deployment descriptor? Select the one correct answer a. <exception> <exception-type> mypackage.MyException </exception-type> <location> /error.jsp</location> </exception> b. <error-page> <exception-type> mypackage.MyException </exception-type> <location> /error.jsp</location> </error-page> c. <error-page> <exception> mypackage.MyException </exception-type> <location> /error.jsp </location> </error-page> d. <error-page> <exception-type> mypackage.MyException </exception-type> </error-page> e. <error-page> <servlet-name> myservlet</servlet-name> <exception-type> mypackage.MyException</exception-type> </error-page> f. <exception> <servlet-name> myservlet</servlet-name> <exception-type> mypackage.MyException</exception-type> </exception>

Back

B

Front

Which is NOT a scope of implicit objects of JSP file? A page B. response C. session D. application E. request

Back

A

Front

______________is the well-known host name that refers to your own computer. A localhost B. DNS С. ір D. computer name

Back

A

Front

Which statements are BEST describe isErrorPage attribute of <%@page isErrorPage=%> directive? A. Specifies if the current page is an error page that will be invoked in response to an error on another page. If the attribute value is true, the implicit object exception is created and references the original excep B. Specifies the MIME type of the data in the response to the client. The default type is text/html C. Any exceptions in the current page that are not caught are sent to the error page for processing. The error page implicit object exception references the original exception D. Specifies the class from which the translated JSP will be inherited. This attribute must be a fully qualified package and class name

Back

Front

Consider the following taglibrary descriptor element <tag> <name>Hello</name> <tag-class>com.abc.HelloTag</tag-class> <body-content> ----- </body-content> </tag> Which of the following is NOT a valid value for <body-content> element? A. empty B. tagdependent C. JSP D. generic

Back

C

Front

Where the bean is declared using the following useBean tag accessible? <jsp:useBean id="jbean" class="com.jclass.JBean" /> A. within other servlets and JSP pages of the same web applications. B. throughout all future invocations of the JSP as long as the servlet engine is running. C. Throughout the remainder of the page. D. throughout all future invocations of the JSP as long as the session is not expired

Back

C

Front

Your web application named "FWorks" uses SpecialMath...class. This is an unbundled class and is not contained in any jar file. Where will you keep this class file? A FWorks/WEB-INF B. FWorks/classes C. FWorks/WEB-INF/classes D. FWorks/WEB-INF/lib/classes

Back

D

Front

Which HTTP method is used in FORM based Authentication? A. GET B. HEAD C. FORM D. POST

Back

B

Front

An object with page scope exists in every JSP of a particular Web application. A True B. false

Back

A

Front

EJB 3.0 specifications are first implemented in ______ A. Java EE 5 B. Java EE 4 C. Java EE 3 D. Java EE 6

Back

C

Front

Consider the Servlet definition in a web.xml file below. (see picture) What will the following line of code return if present in the init() method of TestServlet? getinitParameter(1); A. It Will return "eastern". B. Runtime error. C. Compilation error. D. It Will return null. E. It Will return "US".

Back

B

Front

The form attribute _____specifies the server-side form handler, i.e., the program that handles the request A. name B. action C. localhost D. id

Back

C

Front

Consider the HTML code below. Which of the following method calls can retrieve the "email" value sent from the browser? (Choose one) A getField("email") of HttpServletRequest B. getFormValue("email") of HttpServletRequest C getParameter("email") of ServletRequest D. getParameters("email") ofHttpServlet

Back

B

Front

Your servlet may receive a request, which the servlet cannot handle. In such cases, you want to redirect the request to another resource which may or may not be a part of the same web application. Which of the following options can be used to achieve this objective? A. RequestDispatcher rd = request.getRequestDispatcher("some url"); rd.forward(request, response); B. response.sendRedirect("some url"); C. request.sendRedirect("some url"); D. RequestDispatcher rd = this.getServletContext().getRequestDispatcher("some url"); rd.forward(request, response);

Back

A

Front

JSP _______________ let you insert arbitrary code into the servlet's jspService method (which is called by service). A. scriptlets B. expressions C. declarations

Back

C

Front

In which of the following cases will the method doEndTag() of a tag handler be invoked? A. It will be invoked only if doStartTag() and doAfterBody() complete successfully. B. This method is invoked if doStartTag () method returns true. C. It will be invoked only if doStartTag() or doAfterBody() return Tag.DO_END_TAG. D. It will be invoked in all case even if doStartTag() or doAfterBody() throw an exception.

Back

c

Front

You need to make sure that the response stream of your web application is secure. Which factor will you look at? (Choose one) A. authorization B. authentication C. data integrity

Back

A

Front

What is the implication of using the HTTP GET method for a form submission?(Choose one) A. The parameters will be appended to the URL as a query string. B. You can only reply with the HEADER information in the response. C. None of the others D. You cannot send multiple values for one parameter to the server

Back

B

Front

Identify the parent element of <session-timeout> element in web.xml A. <webapp> B. <session-config> C. <session-configuration> D. <session_config>

Back

B

Front

Which statements are BEST describe prefix attribute of <%@ taglib prefix=...%>directive of JSP file? a. Specifies the relative or absolute URI of the tag library descriptor. b. Specifies the required prefix that distinguishes custom tags from built-in tags. The prefix names jsp, jspx, java, javax, servlet, sun and sunw are reserved. c. Allows programmers to include their own new tags in the form of tag libraries. These libraries can be used to encapsulate functionality and simplify the coding of a JSP. d. The scripting language used in the JSP. Currently, the only valid value for this attribute is java.

Back

B

Front

Study the statements: 1) The special directory /WEB-INF/lib contains Java class files-servlets and supporting code. 2) The special directory /WEB-INF/classes contains JAR files with supporting libraries of code. A. Both 1 and 2 are true B. Both 1 and 2 are not true C. Only statement 2 is true D. Only statement 1 is true

Back

A

Front

Servlet methods are executed automatically. A. True B. False

Back

Front

Consider the following HTML page code. Which method will be called on UploaderServlet when a user .... A doPut B. doPost C. doHead D. do Get

Back

A

Front

The following statement is true or false? "if the isThreadSafe attribute of the page directive is true, then the generated servlet implements the Single ThreadModel interface". A. True B. False

Back

A

Front

To be a servlet, a class should extend HttpServlet and override doGet or doPost, depending on whether the data is being sent by GET or by POST. A True B. false

Back

D

Front

Which of the following elements are used for error handling and are child elements of <web-app> of a deployment descriptor? A. <error-location> B. <error> С. <error-page> D. <error_page>

Back

B

Front

Which is the CORRECT statement about JMS? A. JMS enhances access to email services B. JMS uses JNDI to find destination C. JMS uses JMX to create a connection Factory

Back

A

Front

Study the statements about web.xml file. 1) The deployment descriptor file is called web.xml, and it must be located in the WEB-INF directory. 2) web.xml is in XML (extended markup language) format its root elementis <Web>. A. Only statement 1 is true B. Only statement 2 is true C. Both 1 and 2 are true D. Both 1 and 2 are not true

Back

D

Front

What is the result of attempting to access the following JSP page? <html> <body> <%l public String methodA() { return methodB(); } %> <%l public String methodB() { return "JAD Final Test"; } %> <h2><%= methodA()%></h2> </body> </html> A. A runtime error occurs. B. A translation error occurs. C. The web page is blank. D. "JAD Final Test" is output to the resulting web page.

Back

A

Front

Which of the following statements is true? (Choose one) A. Session data is shared across multiple webapps in the same Webserver/servlet container. B. Any serializable object can be put into a session. C. To use session, the client browser must support cookies. D. A session can only be invalidated after "session-timeout" minutes of inactivity.

Back

C

Front

If you want to send an entity object as the pass by value through a remote interface, which of the following statements are valid? (Choose one) A. public class Employees implements Serializable{ ... } B. @Entity public class Employees implements Serializable{ ... } C. @entity public class Employees implements Serializable{ ... } D. @Entity public class Employees implements SessionSynchronization{ ... }

Back