How to pass SUN 310-083 Real Exam in 24 Hours [book 31-40]

Cause all that matters here is passing the SUN 310-083 exam. Cause all that you need is a high score of 310-083 Sun Certified Web Component Developer for J2EE 5 exam. The only one thing you need to do is downloading Pass4sure 310-083 exam study guides now. We will not let you down with our money-back guarantee.

2016 Aug 310-083 study guide

Q31. The tl:taskList and tl:task tags output a set of tasks to the response and are used as follows:

11. <tl:taskList>

12. <tl:task name="Mow the lawn" />

13. <tl:task name="Feed the dog" />

14. <tl:task name="Do the laundry" />

15. </tl:taskList>

The tl:task tag supplies information about a single task while the tl:taskList tag does the final output. The tag handler for tl:taskList is TaskListTag. The tag handler for tl:task is TaskTag. Both tag handlers extend BodyTagSupport.

Which allows the tl:taskList tag to get the task names from its nested tl:task children?

A. It is impossible for a tag handler that extends BodyTagSupport to communicate with its parent and child tags.

B. In the TaskListTag.doStartTag method, call super.getChildTags() and iterate through the results. Cast each result to a TaskTag and call getName().

C. In the TaskListTag.doStartTag method, call getChildTags() on the PageContext and iterate through the results. Cast each result to a TaskTag and call getName().

D. Create an addTaskName method in TaskListTag. Have the TaskListTag.doStartTag method, return BodyTag.EVAL_BODY_BUFFERED. In the TaskTag.doStartTag method, call super.getParent(), cast it to a TaskListTag, and call addTaskName().

E. Create an addTaskName method in TaskListTag. Have the TaskListTag.doStartTag method, return BodyTag.EVAL_BODY_BUFFERED. In the TaskTag.doStartTag method, call findAncestorWithClass() on the PageContext, passing TaskListTag as the class to find.

Cast the result to TaskListTag and call addTaskName().

Answer: D


Q32. Which interface must a session attribute implement if it needs to be notified when a web container persists a session?

A. javax.servlet.http.HttpSessionListener

B. javax.servlet.http.HttpSessionBindingListener

C. javax.servlet.http.HttpSessionAttributeListener

D. javax.servlet.http.HttpSessionActivationListener

Answer: D


Q33. Which defines the welcome files in a web application deployment descriptor?

A. <welcome>

<welcome-file>/welcome.jsp</welcome-file>

</welcome>

<welcome>

. <welcome-file>/index.html</welcome-file>

. </welcome>

B. <welcome-file-list>

. <welcome-file>welcome.jsp</welcome-file>

. <welcome-file>index.html</welcome-file>

. </welcome-file-list>

C. <welcome>

. <welcome-file>welcome.jsp</welcome-file>

. </welcome>

. <welcome>

. <welcome-file>index.html</welcome-file>

. </welcome>

D. <welcome-file-list>

<welcome-file>/welcome.jsp</welcome-file>

<welcome-file>/index.html</welcome-file>

</welcome-file-list>

E. <welcome>

. <welcome-file>

. <welcome-name>Welcome</welcome-name>

. <location>welcome.jsp</location>

. </welcome-file>

. <welcome-file>

. <welcome-name>Index</welcome-name>

. <location>index.html</location>

. </welcome-file>

. </welcome>

Answer: B


Q34. A developer is designing a web application that must support multiple interfaces, including:

an XML web service for B2B HTML for web-based clients WML for wireless customers Which design pattern provides a solution for this problem?

A. Session Facade

B. Business Delegate

C. Data Access Object

D. Model-View-Controller

E. Chain of Responsibility

Answer: D


Q35. Given a header in an HTTP request:

X-Retries: 4

Which two retrieve the value of the header from a given HttpServletRequest request? (Choose two.)

A. Request.getHeader("X-Retries")

B. Request.getIntHeader("X-Retries")

C. Request.getRequestHeader("X-Retries")

D. Request.getHeaders("X-Retries").get(0)

E. Request.getRequestHeaders("X-Retries").get(0)

Answer: AB


310-083 braindumps

Update 310-083 free practice exam:

Q36. Click the Exhibit button.

Given the HTML form:

1. <html>

2. <body>

3. <form action="submit.jsp">

4. Name: <input type="text" name="i1"><br>

5. Price: <input type="text" name="i2"><br>

6. <input type="submit">

7. </form>

8. </body>

9. </html>

Assume the product attribute does NOT yet exist in any scope. Which code snippet, in submit.jsp, instantiates an instance of com.example.Product that contains the results of the form submission?

Exhibit:


A. <jsp:useBean id="com.example.Product" />

<jsp:setProperty name="product" property="*" />

B. <jsp:useBean id="product" class="com.example.Product" /> ${product.name = param.i1}

. ${product.price = param.i2}

C. <jsp:useBean id="product" class="com.example.Product"> . <jsp:setProperty name="product" property="name"

param="i1" />

<jsp:setProperty name="product" property="price"

. param="i2" />

. </jsp:useBean>

D. <jsp:useBean id="product" type="com.example.Product"> . <jsp:setProperty name="product" property="name"

value="<%= request.getParameter( "i1" ) %>" />

. <jsp:setProperty name="product" property="price" value="<%= request.getParameter( "i2" ) %>" />

.</jsp:useBean>

Answer: C


Q37. In which two locations can library dependencies be defined for a web application? (Choose two.)

A. The web application deployment descriptor

B. The /META-INF/dependencies.xml file

C. The /META-INF/MANIFEST.MF manifest file

D. The /META-INF/MANIFEST.MF manifest of a JAR in the web application classpath

Answer: CD


Q38. You have a simple web application that has a single Front Controller servlet that dispatches to JSPs to generate a variety of views. Several of these views require further database processing to retrieve the necessary order object using the orderID request parameter. To do this additional processing, you pass the request first to a servlet that is mapped to the URL pattern /WEB INF/retreiveOrder.do in the deployment descriptor. This servlet takes two request parameters, the orderID and the jspURL. It handles the database calls to retrieve and build the complex order objects and then it dispatches to the jspURL. Which code snippet in the Front Controller servlet dispatches the request to the order retrieval servlet?

A. request.setAttribute("orderID", orderID);

. request.setAttribute("jspURL", jspURL);

. RequestDispatcher view

. = context.getRequestDispatcher("/WEB-INF/retreiveOrder.do"); view.forward(request, response);

B. request.setParameter("orderID", orderID);

. request.setParameter("jspURL", jspURL);

. Dispatcher view

. = request.getDispatcher("/WEB-INF/retreiveOrder.do"); view.forwardRequest(request, response);

C. String T="/WEB-INF/retreiveOrder.do?orderID=%d&jspURL=%s"; . String url = String.format(T, orderID, jspURL);

. RequestDispatcher view

.= context.getRequestDispatcher(url);

view.forward(request, response);

D. String T="/WEB-INF/retreiveOrder.do?orderID=%d&jspURL=%s"; . String url = String.format(T, orderID, jspURL);

. Dispatcher view

. = context.getDispatcher(url);

view.forwardRequest(request, response);

Answer: C


Q39. You are creating a library of custom tags that mimic the HTML form tags. When the user submits a form that fails validation, the JSP form is forwarded back to the user. The

<t:textField> tag must support the ability to re-populate the form field with the request parameters from the user's last request. For example, if the user entered "Samantha" in the text field called firstName, then the form is re-populated like this:

<input type='text' name='firstName' value='Samantha' /> Which tag handler method will accomplish this goal?

A. public int doStartTag() throws JspException {

. JspContext ctx = getJspContext();

String value = ctx.getParameter(this.name);

if ( value == null ) value = "";

JspWriter out = pageContext.getOut();

try {

out.write(String.format(INPUT, this.name, value)); } (Exception e) { throw new JspException(e); }

return SKIP_BODY;

}

private static String INPUT

= "<input type='text' name='%s' value='%s' />";

B. public void doTag() throws JspException {

. JspContext ctx = getJspContext();

. String value = ctx.getParameter(this.name);

. if ( value == null ) value = "";

. JspWriter out = pageContext.getOut();

try {

. out.write(String.format(INPUT, this.name, value)); . } (Exception e) { throw new JspException(e); }

. }

. private static String INPUT

. = "<input type='text' name='%s' value='%s' />";

C. public int doStartTag() throws JspException {

. ServletRequet request = pageContext.getRequest(); . String value = request.getParameter(this.name);

. if ( value == null ) value = "";

. JspWriter out = pageContext.getOut();

try {

. out.write(String.format(INPUT, this.name, value)); . } (Exception e) { throw new JspException(e); }

. return SKIP_BODY;

. }

. private static String INPUT

. = "<input type='text' name='%s' value='%s' />";

D. public void doTag() throws JspException {

. ServletRequet request = pageContext.getRequest(); . String value = request.getParameter(this.name);

. if ( value == null ) value = "";

. JspWriter out = pageContext.getOut();

try {

. out.write(String.format(INPUT, this.name, value)); . } (Exception e) { throw new JspException(e); }

. }

. private static String INPUT

. = "<input type='text' name='%s' value='%s' />";

Answer: C


Q40. A developer is designing a web application which extensively uses EJBs and JMS. The developer finds that there is a lot of duplicated code to build the JNDI contexts to access the beans and queues. Further, because of the complexity, there are numerous errors in the code. Which J2EE design pattern provides a solution for this problem?

A. Command

B. Transfer Object

C. Service Locator

D. Session Facade

E. Business Delegate

F. Data Access Object

Answer: C



see more 310-083 dumps