Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
CWNP exams CWNP
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
GIAC exams GIAC
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
ISEB exams ISEB
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Sun 310-085 Exam - Cheat-Test.com

Free 310-085 Sample Questions:

Q: 1
In which of the following tags can the <sql:dateParam> tag be nested?
Each correct answer represents a complete solution. Choose all that apply.
A. <sql:transaction>
B. <sql:update>
C. <sql:setDataSource>
D. <sql:query>
Answer: B, D

Q: 2
Which of the following code will you use to set the ${param.name} expression value to the variable 'username'?
A. <c:param var=username value="${param.name}" />
B. <c:setVar var=username value="${param.name}" />
C. <c:import var=username value="${param.name}" />
D. <c:set var=username value="${param.name}" />
Answer: D

Q: 3
Which of the following actions trigger a Web browser to send a HTTP GET request?
Each correct answer represents a complete solution. Choose all that apply.
A. When a user submits a form that specifies attribute method="GET".
B. When a user clicks a link.
C. When a user types a URL in the browser's address bar.
D. When a user submits a form that specifies NO method attribute.
Answer: A, B, C, D

Q: 4
Which of the following are the valid methods in the JspContext class?
Each correct answer represents a complete solution. Choose all that apply.
A. getAttribute()
B. getVariableResolver()
C. popBody()
D. findAttribute()
E. getBody()
F. pushBody()
Answer: A, B, C, D, F

Q: 5
Assume that you have two jsp files with the logic given as follows:
FilE. first.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding ="ISO-8859-1"% >
<html>
<head>
</head>
<body>
<jsp:include page="second.jsp" >
<jsp:param name="acctType" value="Saving" />
<jsp:param name="acctType " value="Checking" />
</jsp:include>
</body>
</html>
FilE. second.jsp
<%
String acctTypes[] = request.getParameterValues("acctType");
for (String accountType : acctTypes) {
out.print(accountType + " ");
}
%>
When you try to access first.jsp with the following url, what would be the output?
http://localhost:9080/BankApp/first.jsp?acctType=Credit
A. Saving Checking
B. Prints Saving, Checking, and Credit in random order.
C. Credit Saving Checking
D. Saving Checking Credit
Answer: D

Q: 6
Fill in the required element name in the space provided in the statement below.
The_____ element stands for runtime expression and specifies whether the attribute is evaluated at translation or runtime.
A. rtexprvalue
Answer: A

Q: 7
Assume that your jsp page has multiple account types to select that the accounts you have as check boxes. Which of the below returns the first value when EL expression evaluates?
Each correct answer represents a complete solution. Choose all that apply.
A. ${paramValue.acctTypes[0]}
B. ${paramValues.acctTypes[0]}
C. ${paramValues.acctTypes[1]}
D. ${param.acctTypes}
Answer: B, D

Q: 8
Which of the following statements about context initialization parameters are true?
Each correct answer represents a complete solution. Choose all that apply.
A. These parameters can be obtained by using the getInitParameter() and the getInitParameterNames() methods of the ServletConfig interface.
B. These parameters can be obtained using the getInitParameter() and the getInitParameterNames() methods of the ServletContext interface.
C. These parameters are declared in the deployment descriptor using the <init-param> element.
D. These parameters are applicable for the entire Web application.
Answer: B, D

Q: 9
Which of the following is a utility class intended to be used as the base class for new tag handlers and implements the Tag and IterationTag interfaces?
A. TagSupport
B. JspTag
C. ConditionalTagSupport
D. LoopTagSupport
E. BodyTagSupport
Answer: A

Q: 10
Which of the following XML format tags do not have an equivalent in JSP syntax format?
Each correct answer represents a complete solution. Choose all that apply.
A. <jsp:directive.page/>
B. <jsp:text></jsp:text>
C. <jsp:directive.include/>
D. <jsp:root></jsp:root>
Answer: B, D

Q: 11
Which of the following functions can be performed by the pageContext implicit object?
Each correct answer represents a complete solution. Choose all that apply.
A. Handling errorpage exception processing
B. Managing user sessions
C. Getting attributes from various scopes
D. Managing custom tags
Answer: A, B, C

Q: 12
Which of the following exceptions will be thrown by the forward method if the
ServletOutputStream or a writer had already been obtained from the response object?
A. IOException
B. IllegalStateException
C. ServletException
D. UnavailableException
Answer: B

Q: 13
Assume that you are developing a distributed application. Which of the following statements are true about the session management of a distributed application?
Each correct answer represents a complete solution. Choose all that apply.
A. You can use ServletContext for sharing information.
B. You can use cookies for session management.
C. You can use the sendRedirect() method to send a temporary redirect response to an
application.
D. You can use the include() and forward() methods of RequestDispatcher to include or
forward the request.
Answer: A, D

Q: 14
All of the following methods are inherited from interface javax.servlet.jsp.tagext.Tag except for which one?
A. setParent()
B. release()
C. setPageContext()
D. getContext()
Answer: D

Q: 15
Which of the following values is returned by the doStartTag() method?
A. EVAL_PAGE
B. SKIP_PAGE
C. LOOP_BODY
D. SKIP_BODY
Answer: D

Q: 16
Which of the following exceptions will be thrown by the getAttributeNamesInScope() method if the scope is PageContext.SESSION_SCOPE, but the page that was requested does not participate in the session or the session has been invalidated?
A. PathNotFoundException
B. IllegalArgumentException
C. IllegalStateException
D. NullPointerException
Answer: C

Q: 17
Which of the following interfaces provides the getCookies() method to obtain an array of cookies that are present in the request?
A. javax.servlet.http.Cookie
B. HttpServletResponse
C. HttpServletRequest
D. ServletRequest
Answer: C

Q: 18
Which of the following methods ends the existing session and unbinds all the objects associated with the session?
A. commit()
B. destroy()
C. invalidate()
D. ejbRemove()
Answer: C

Q: 19
You work as a Software Developer for uCertify Inc. You want to build a design pattern that has minimum network traffic and carries multiple data elements across a tier. Which of the following design patterns will you use to accomplish the task?
A. Transfer Object
B. Front Controller
C. Model-View-Controller
D. Business Delegate
Answer: A

Q: 20
Which of the following statements are true about Simple tag?
Each correct answer represents a complete solution. Choose all that apply.
A. The setJspBody() is invoked prior to the doTag().
B. The setParent() and setJspContext() methods are called before doStartTag().
C. The doStartTag() method is always called before doTag().
D. The setJspBody() method is always invoked.
Answer: A, B

Q: 21
Which of the following XML format tags do not have an equivalent in JSP syntax format?
Each correct answer represents a complete solution. Choose all that apply.
A. <jsp:directive.include/>
B. <jsp:text></jsp:text>
C. <jsp:root></jsp:root>
D. <jsp:directive.page/>
Answer: B, C

Q: 22
You work as a Software Developer for BlueWell Inc. While maintaining a Web application, you find that the number of calls made by the client to the enterprise bean impacts network performance, as all access to the enterprise bean is performed via remote interfaces to the bean. The increase in network traffic between client and server tiers degrades network performance. Which of the following design patterns will you use to resolve the issue?
A. Service Locator
B. Front Controller
C. Business Delegate
D. Transfer Object
E. Model-View-Controller
Answer: D

Q: 23
Which of the following exceptions will be thrown by the forward method if the ServletOutputStream or a writer had already been obtained from the response object?
A. ServletException
B. IllegalStateException
C. UnavailableException
D. IOException
Answer: B

Q: 24
Which of the following conditions will force a classic tag handler to instruct the container to ignore the remainder of the JSP page that invoked the tag?
A. When the doStartTag() method returns Tag.SKIP_PAGE
B. When the doEndTag() method returns Tag.SKIP_PAGE
C. When the doAfterBody() method returns Tag.SKIP_PAGE
D. When the doInitBody() method returns Tag.SKIP_PAGE
Answer: B

Q: 25
Which of the following statements are true about the empty operator in EL?
Each correct answer represents a complete solution. Choose all that apply.
A. The empty operator returns true when its parameter argument is null.
B. The empty operator returns true when its parameter argument is an empty string.
C. The empty operator is not a valid operator in jsp expression language.
D. The empty operator returns true when its parameter argument is an empty array, an empty Map, or an empty collection.
Answer: A, B, D

Q: 26
Assume that your jsp has the following <jsp:useBean> taG.
<jsp:useBean id="account" class="AccountBean" />
Which of the following is a valid scope for a bean object account?
A. context
B. application
C. page
D. request
E. session
Answer: C

Q: 27
Assume an applet is packaged as a jar. Which directory in deployment structure should have this jar so that the applet is accessible?
A. WEB-INF/classes
B. WEB-INF/lib
C. Keep the class in WEB-INF/classes without creating jar.
D. Keep anywhere in the document root of the application except the WEB-INF directory and its subdirectories.
Answer: D

Q: 28
Which of the following standard action declarations will be used to store all the values, which a user enters in a viewable JSP page in matching Bean properties? (If application scope is used with BeanName instance name, and myBean is the class name in the package BeanCode.)
A. <jsp:useBean id="BeanName" scope="application" class= "BeanCode.myBean">
<jsp:params name="BeanName" property="*" value="*"/>
</jsp:useBean>
B. <jsp:setProperty name="BeanName" property="*"/>
C. <jsp:useBean id="BeanName" scope="application" class= "BeanCode.myBean">
<jsp:param name="BeanName" property="*" value="*"/>
</jsp:useBean>
D. <jsp:useBean id="BeanName" scope="application" class= "BeanCode.myBean">
<jsp:setProperty name="BeanName" property="*"/>
</jsp:useBean>
Answer: D

Q: 29
You work as a programmer for uCertify.Inc. You develop a JSP page that provides rich graphical layout. Which of the following JSP standard actions will you use to import an image file named BeanImage.gif into a JSP page?
A. <jsp: image page="BeanImage.gif" />
B. <jsp: include file="BeanImage.gif" />
C. <jsp: include page="BeanImage.gif" />
D. This cannot be done by using standard actions.
E. <jsp: image file="BeanImage.gif" />
Answer: D

Q: 30
Which of the following statements about the <jsp:useBean> standard action are true?
Each correct answer represents a complete solution. Choose all that apply.
A. The beanName attribute is optional.
B. The id and class attributes are optional.
C. If the scope is not specified, it takes the default scope, which is session.
D. Either the type or class attribute must be specified.
Answer: A, D


© 2014 Cheat-Test.com, All Rights Reserved