SUN 310-083 Demo Free Download, First-hand SUN 310-083 Study Guides UP To 50% Off

There is No need to hassle if you are stuck in the SUN 310-083 exam difficulties,Flydumps will assist you right through exam specific preparation material.Flydumps delivers the most comprehensive preparation material,covering each and every aspect of SUN 310-083 exam curriculum.

QUESTION NO: 1

You need to store a Java long primitive attribute, called customerOID, into the session scope. Which two code snippets allow you to insert this value into the session? (Choose two.)
A. long customerOID = 47L;
session.setAttribute(“customerOID”, new Long(customerOID));

B. long customerOID = 47L;
session.setLongAttribute(“customerOID”, new Long(customerOID));

C. long customerOID = 47L;
session.setAttribute(“customerOID”, customerOID); D. long
customerOID = 47L; session.setNumericAttribute(“customerOID”, new
Long(customerOID)); E. long customerOID = 47L;
session.setLongAttribute(“customerOID”, customerOID);

F. long customerOID = 47L; . session.setNumericAttribute(“customerOID”, customerOID);

Answer: A,C

QUESTION NO: 2
A developer for the company web site has been told that users may turn off cookie support in their browsers. What must the developer do to ensure that these customers can still use the web application?
A. The developer must ensure that every URL is properly encoded using the appropriate URL rewriting APIs.
B. The developer must provide an alternate mechanism for managing sessions and abandon the HttpSession mechanism entirely.
C. The developer can ignore this issue. Web containers are required to support automatic URL rewriting when cookies are not supported.
D. The developer must add the string id=<sessionid> to the end of every URL to ensure that the conversation with the browser can continue.
Answer: A

QUESTION NO: 3
Your web application requires the adding and deleting of many session attributes during a complex use case. A bug report has come in that indicates that an important session attribute is being deleted too soon and a NullPointerException is being thrown several interactions after the fact. You have decided to create a session event listener that will log when attributes are being deleted so you can track down when the attribute is erroneously being deleted.
Which listener class will accomplish this debugging goal?
A. Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object.
B. Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object.
C. Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object.
D. Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object.
Answer: B

QUESTION NO: 4
As a convenience feature, your web pages include an Ajax request every five minutes to a special servlet that monitors the age of the user’s session. The client-side JavaScript that handles the Ajax callback displays a message on the screen as the session ages. The Ajax call does NOT pass any cookies, but it passes the session ID in a request parameter called sessionID. In addition, assume that your webapp keeps a hashmap of session objects by the ID. Here is a partial implementation of this servlet:
10.
public class SessionAgeServlet extends HttpServlet {

11.
public void service(HttpServletRequest request, HttpServletResponse) throws IOException {

12.
String sessionID = request.getParameter(“sessionID”);

13.
HttpSession session = getSession(sessionID);

14.
long age = // your code here

15.
response.getWriter().print(age);

16.
} … // more code here
47. }
Which code snippet on line 14, will determine the age of the session?
A. session.getMaxInactiveInterval();
B. session.getLastAccessed().getTime() – session.getCreationTime().getTime();
C. session.getLastAccessedTime().getTime() – session.getCreationTime().getTime();
D. session.getLastAccessed() – session.getCreationTime();
E. session.getMaxInactiveInterval() – session.getCreationTime();
F. session.getLastAccessedTime() – session.getCreationTime();
Answer: F

QUESTION NO: 5
Which statement is true about web container session management?
A. Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
B. To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.
C. If the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.
D. The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.
Answer: C

QUESTION NO: 6
One of the use cases in your web application uses many session-scoped attributes. At the end of
the use case, you want to clear out this set of attributes from the session object.
Assume that this static variable holds this set of attribute names:
201.
private static final Set<String> USE_CASE_ATTRS;

202.
static {

203.
USE_CASE_ATTRS.add(“customerOID”);

204.
USE_CASE_ATTRS.add(“custMgrBean”);

205.
USE_CASE_ATTRS.add(“orderOID”);

206.
USE_CASE_ATTRS.add(“orderMgrBean”);

207.
}
Which code snippet deletes these attributes from the session object?
A. session.removeAll(USE_CASE_ATTRS);

B. for ( String attr : USE_CASE_ATTRS ) { session.remove(attr);
}

C. for ( String attr : USE_CASE_ATTRS ) {
session.removeAttribute(attr);
}

D. for ( String attr : USE_CASE_ATTRS ) {
session.deleteAttribute(attr);
}

E. session.deleteAllAttributes(USE_CASE_ATTRS);

Answer: C

QUESTION NO: 7
Assume that a news tag library contains the tags lookup and item: lookup Retrieves the latest news headlines and executes the tag body once for each headline. Exposes a NESTED page scoped attribute called headline of type com.example.Headline containing details for that headline. item Outputs the HTML for a single news headline. Accepts an attribute info of type com.example.Headline containing details for the headline to be rendered.Which snippet of JSP code returns the latest news headlines in an HTML table, one per row?
A. <table>
<tr>
<td>
<news:lookup />
<news:item info=”${headline}” />
</td>
</tr>
. </table>

B. <news:lookup />
<table>
<tr>
<td><news:item info=”${headline}” /></td>
</tr>
</table>

C. <table>
. <news:lookup>
. <tr>
. <td><news:item info=”${headline}” /></td>
. </tr>
. </news:lookup>
. </table>

D. <table>
<tr>
. <news:lookup>
. <td><news:item info=”${headline}” /></td>
. </news:lookup>

. </tr> . </table>
Answer: C

QUESTION NO: 8
Which JSTL code snippet can be used to perform URL rewriting?
A. <a href='<c:url url=”foo.jsp”/>’ />
B. <a href='<c:link url=”foo.jsp”/>’ />
C. <a href='<c:url value=”foo.jsp”/>’ />
D. <a href='<c:link value=”foo.jsp”/>’ />
Answer: C

QUESTION NO: 9
Assume the scoped attribute priority does NOT yet exist. Which two create and set a new request- scoped attribute priority to the value “medium”? (Choose two.)
A. ${priority = ‘medium’}
B. ${requestScope[‘priority’] = ‘medium’}
C. <c:set var=”priority” value=”medium” />
D. <c:set var=”priority” scope=”request”>medium</c:set>
E. <c:set var=”priority” value=”medium” scope=”request” />
F. <c:set property=”priority” scope=”request”>medium</c:set>
G. <c:set property=”priority” value=”medium” scope=”request” />
Answer: D,E

QUESTION NO: 10
You are creating a JSP page to display a collection of datA. This data can be displayed in several different ways so the architect on your project decided to create a generic servlet that generates a comma-delimited string so that various pages can render the data in different ways. This servlet takes on request parameter: objectID. Assume that this servlet is mapped to the URL pattern: /WEB-INF/data.
In the JSP you are creating, you need to split this string into its elements separated be commas and generate an HTML <ul> list from the datA. Which JSTL code snippet will accomplish this goal?
A. <c:import varReader=’dataString’ url=’/WEB-INF/data’>
<c:param name=’objectID’ value=’${currentOID}’ />
</c:import>
<ul>
<c:forTokens items’${dataString.split(“,”)}’ var=’item’>
<li>${item}</li>
</c:forTokens>
</ul>

B. <c:import varReader=’dataString’ url=’/WEB-INF/data’>
. <c:param name=’objectID’ value=’${currentOID}’ />
. </c:import>
. <ul>
. <c:forTokens items’${dataString}’ delims=’,’ var=’item’>
. <li>${item}</li>
. </c:forTokens>
. </ul>

C. <c:import var=’dataString’ url=’/WEB-INF/data’>
. <c:param name=’objectID’ value=’${currentOID}’ />

. </c:import>
. <ul>
. <c:forTokens items’${dataString.split(“,”)}’ var=’item’>
. <li>${item}</li>
</c:forTokens>
. </ul>

D. <c:import var=’dataString’ url=’/WEB-INF/data’>
<c:param name=’objectID’ value=’${currentOID}’ />
</c:import>
<ul>
. <c:forTokens items’${dataString}’ delims=’,’ var=’item’>
. <li>${item}</li>
</c:forTokens>
. </ul>

Answer: D
QUESTION NO: 11
Which three are true about TLD files? (Choose three.)
A. The web container recognizes TLD files placed in any subdirectory of WEB-INF.
B. When deployed inside a JAR file, TLD files must be in the META-INF directory, or a subdirectory of it.
C. A tag handler’s attribute must be included in the TLD file only if the attribute can accept request-time expressions.
D. The web container can generate an implicit TLD file for a tag library comprised of both simple tag handlers and tag files.
E. The web container can automatically extend the tag library map described in a web.xml file by including entries extracted from the web application’s TLD files.
Answer: A,B,E

QUESTION NO: 12
Your management has required that all JSPs be created to generate XHTML-compliant content and to facilitate that decision, you are required to create all JSPs using the JSP Document format. In the reviewOrder.jspx page, you need to use several core JSTL tags to process the collection of order items in the customer’s shopping cart. Which JSP code snippets must you use in the reviewOrder.jspx page?
A. <html xmlns:jsp=http://java.sun.com/JSP/Page version=”2.0″>
<jsp:directive.taglib prefix=”c”
uri=”http://java.sun.com/jsp/jstl/core” />
<!– page content –>
</html>

B. <html xmlns:jsp=”http://java.sun.com/JSP/Page”
version=”2.0″
xmlns:c=”http://java.sun.com/jsp/jstl/core”>
<!– page content –>
</html>

C. <jsp:root xmlns:jsp=”http://java.sun.com/JSP/Page”
version=”2.0″>
<jsp:directive.taglib prefix=”c”
uri=”http://java.sun.com/jsp/jstl/core” />
. <!– page content –>
. </jsp:root>

D. <jsp:root xmlns:jsp=”http://java.sun.com/JSP/Page”
version=”2.0″
xmlns:c=”http://java.sun.com/jsp/jstl/core”>
<!– page content –>
. </jsp:root>

Answer: D

QUESTION NO: 13
Which two JSTL URL-related tags perform URL rewriting? (Choose two.)
A. Url
B. Link
C. Param
D. Import
E. Redirect
Answer: A,E

QUESTION NO: 14
A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed. Which two are true? (Choose two.)
A. The <body-content> element in the echo tag TLD must have the value JSP.
B. The echo tag handler must define the setAttribute(String key, String value) method.
C. The <dynamic-attributes>true</dynamic-attributes> element must appear in the echo tag TLD.
D. The class implementing the echo tag handler must implement the javax.servlet.jsp.tagext.IterationTag interface.
E. The class implementing the echo tag handler must implement the
F. .javax.servlet.jsp.tagext.DynamicAttributes interface.
Answer: C,E

QUESTION NO:15
A developer has used this code within a servlet:
62.
if(request.isUserInRole(“vip”)) {

63.
// VIP-related logic here

64.
}
What else must the developer do to ensure that the intended security goal is achieved?
A. Create a user called vip in the security realm
B. Define a group within the security realm and call it vip
C. Define a security-role named vip in the deployment descriptor
D. Declare a security-role-ref for vip in the deployment descriptor
Answer: D
QUESTION NO: 16
Given:
3.
class MyServlet extends HttpServlet {

4.
public void doPut(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
5.
// servlet code here …

26.
}
27.
}
If the DD contains a single security constraint associated with MyServlet and its only <http
method> tags and <auth-constraint> tags are:
<http-method>GET</http-method>
<http-method>PUT</http-method>
<auth-constraint>Admin</auth-constraint>

Which four requests would be allowed by the container? (Choose four.)
A. A user whose role is Admin can perform a PUT.
B. A user whose role is Admin can perform a GET. C. A user whose role is Admin can perform a POST. D. A user whose role is Member can perform a PUT. E. A user whose role is Member can perform a POST. F. A user whose role is Member can perform a GET.
Answer: A,B,C,E

QUESTION NO: 17
What is true about Java EE authentication mechanisms?
A. If your deployment descriptor correctly declares an authentication type of CLIENT_CERT, your users must have a certificate from an official source before they can use your application.
B. If your deployment descriptor correctly declares an authentication type of BASIC, the container automatically requests a user name and password whenever a user starts a new session.
C. If you want your web application to support the widest possible array of browsers, and you want to perform authentication, the best choice of Java EE authentication mechanisms is DIGEST.
D. To use Java EE FORM authentication, you must declare two HTML files in your deployment descriptor, and you must use a predefined action in the HTML file that handles your user’s login.
Answer: D

QUESTION NO: 18
If you want to use the Java EE platform’s built-in type of authentication that uses a custom HTML page for authentication, which two statements are true? (Choose two.)
A. Your deployment descriptor will need to contain this tag: <authmethod> CUSTOM</auth- method>.
B. The related custom HTML login page must be named loginPage.html.
C. When you use this type of authentication, SSL is turned on automatically.
D. You must have a tag in your deployment descriptor that allows you to point to both a login HTML page and an HTML page for handling any login errors.
E. In the HTML related to authentication for this application, you must use predefined variable names for the variables that store the user and password values.
Answer: D,E

QUESTION NO: 19
Given this fragment in a servlet:
23.
if(req.isUserInRole(“Admin”)) {
24.
// do stuff
25.
}
And the following fragment from the related Java EE deployment descriptor:

812.
<security-role-ref>
813.
<role-name>Admin</role-name>
814.
<role-link>Administrator</role-link>
815.
</security-role-ref>

900.
<security-role>
901.
<role-name>Admin</role-name>
902.
<role-name>Administrator</role-name>
903.
</security-role>

What is the result?
A. Line 24 can never be reached.
B. The deployment descriptor is NOT valid.
C. If line 24 executes, the user’s role will be Admin.
D. If line 24 executes, the user’s role will be Administrator.
E. If line 24 executes the user’s role will NOT be predictable.
Answer: D

QUESTION NO: 20
Given the security constraint in a DD:
101.
<security-constraint>

102.
<web-resource-collection>

103.
<web-resource-name>Foo</web-resource-name>

104.
<url-pattern>/Bar/Baz/*</url-pattern>

105.
<http-method>POST</http-method>

106.
</web-resource-collection>

107.
<auth-constraint>

108.
<role-name>DEVELOPER</role-name>

109.
</auth-constraint>

110.
</security-constraint>
And given that “MANAGER” is a valid role-name, which four are true for this security constraint? (Choose four.)
A. MANAGER can do a GET on resources in the /Bar/Baz directory.
B. MANAGER can do a POST on any resource in the /Bar/Baz directory.
C. MANAGER can do a TRACE on any resource in the /Bar/Baz directory.
D. DEVELOPER can do a GET on resources in the /Bar/Baz directory.
E. DEVELOPER can do only a POST on resources in the /Bar/Baz directory.
F. DEVELOPER can do a TRACE on any resource in the /Bar/Baz directory.
Answer: A,C,D,F

SUN 310-083 Exam Certification Guide is part of a recommended study program from SUN 310-083 that includes simulation and hands-on training from authorized SUN 310-083 Learning Partners and self-study products from SUN 310-083.Find out more about instructor-led, e-learning, and hands-on instruction offered by authorized SUN 310-083 Learning Partners worldwide

  •  
  •  
  •  
  •  
  •