happychengyuan's picture
From happychengyuan rss RSS  subscribe Subscribe

Actual SUN 310-085 practice exam questions 

JavaServer Pages and Servlet Developer Certified Expert Exam is the full name of the latest updated SUN 310-085 practice exam questions, which is written to the highest standards of technical accuracy, provided by Killtest certified subject matter experts and published authors for development. All the students who bought this 310-085 exam dumps from us have all passed successfully by their first try and after you purchase this exam from us, we will send both 310-085 pdf and software version to you in time.

 

 
 
Tags:  310-085  practice  exam  questions 
Views:  57
Published:  December 01, 2011
 
0
download

Share plick with friends Share
save to favorite
Report Abuse Report Abuse
 
Related Plicks
PTCB Exam | PTCB Syllabus | PTCB exam questions | PTCB questions | PTCB practice test

PTCB Exam | PTCB Syllabus | PTCB exam questions | PTCB questions | PTCB practice test

From: jonymark112233
Views: 29 Comments: 0
This site was created for pharmacy technicians wishing to pass the PTCB Exam. Included are 40 free sample PTCB Exam questions and PTCB test preparation tips.

 
Practice Exam Software for Students and Coaching Institutes by Examination Online

Practice Exam Software for Students and Coaching Institutes by Examination Online

From: examinationonline
Views: 9 Comments: 0
Examination Online provides online exam solution for students, coaching institutes & organizations. We provide custom solutions for practice exam also.
 
Testinside 9A0-036

Testinside 9A0-036

From: ccna4
Views: 306 Comments: 0

 
See all 
 
More from this user
Ourexam Cisco 650-568 study guide

Ourexam Cisco 650-568 study guide

From: happychengyuan
Views: 1052
Comments: 0

Ourexam Cisco 350-018 test braindumps

Ourexam Cisco 350-018 test braindumps

From: happychengyuan
Views: 738
Comments: 0

HP HP0-Y29 actual exam

HP HP0-Y29 actual exam

From: happychengyuan
Views: 439
Comments: 0

Ourexam HP HP0-J41 test questions

Ourexam HP HP0-J41 test questions

From: happychengyuan
Views: 1313
Comments: 0

Ourexam latest 000-532 exam simulation

Ourexam latest 000-532 exam simulation

From: happychengyuan
Views: 459
Comments: 0

Get Killtest BH0-008 exam materials

Get Killtest BH0-008 exam materials

From: happychengyuan
Views: 285
Comments: 0

See all 
 
 
 URL:          AddThis Social Bookmark Button
Embed Thin Player: (fits in most blogs)
Embed Full Player :
 
 

Name

Email (will NOT be shown to other users)

 

 
 
Comments: (watch)
 
 
Notes:
 
Slide 1: Killtest is the best choice for all your IT exam preparation. Before you buy these exams from us, we can offer you some free demos of each products. You can check out the interface, question quality and usability of our practice exams before you decide to buy. The followings are some latest and hottest exams in Killtest now, such as the VCP-510 exam, SY0-301 exam, EX0-115 exam, HP2-H18 exam, 250-310 exam, 000-581 exam and so on. Welcome to Killtest.com now, then get more benefits from there.
Slide 2: The safer , easier way to help you pass any IT exams. Exam : 310-085 Title : JavaServer Pages and Servlet Developer Certified Expert Exam Version : Demo 1 / 12
Slide 3: The safer , easier way to help you pass any IT exams. 1.Assume that the session attribute you are using is implementing the required listener interface. When the session is invalidated, which of the following is correct related to the attribute listener? A. The sessionDestroyed() method of the HttpSessionBindingListener interface is invoked. B. The valueUnbound() method of the HttpSessionListener interface is invoked. C. The valueUnbound() method of the HttpSessionBindingListener interface is invoked. D. The sessionDestroyed() method of the HttpSessionListener interface is invoked. Answer: C 2.Which of the following web.xml declarations are valid ways of identifying all jsp files under member directory of a bank.? Each correct answer represents a complete solution. Choose all that apply. A. <web-resource-collection> <web-resource-name>member</web-resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> </web-resource-collection> B. <web-resource-collection> <web-resource-name>member</web-resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> <http-method>POST</http-method> </web-resource-collection> C. <resource-collection> <web-resource-name>member</web-resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> </resource-collection> D. <web-resource-collection> <resource-name>member</resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> </web-resource-collection> Answer: A, B 3.Assume that you have the listener class in your application that is declared in web.xml. The code for the listener class is as follows: public class MyServletContextAttributeListener implements ServletContextAttributesListener { public void attributeAdded (ServletContextAttributeEvent event) { System.out.println(event.getValue()); } public void attributeRemoved (ServletContextAttributeEvent event) { System.out.println(event.getValue()); } public void attributeReplaced (ServletContextAttributeEvent event) { System.out.println(event.getValue()); } } 2 / 12
Slide 4: The safer , easier way to help you pass any IT exams. The logic you are using to work on the context attributes is given as follows: public void doGet(HttpServletRequest req, HttpServletResponse resp) { ServletContext context = req.getServletContext(); //1.context.setAtttribute("A", "X"); //2.context.setAtttribute("A", "Y"); //3.context.removeAtttribute("A"); .//4.} Which of the following is a correct output when the doGet() method is successfully executed? A. XY B. XYX C. XY D. XXY Answer: D 4.Consider the following implementation class for the interface ServletRequestAttributeListener. public class AccountServletAttributeListener implements ServletRequestAttributeListener { public void attributeAdded(ServletRequestAttributeEvent srae) { System.out.println("Attribute added : "+srae.getName()) } public void attributeRemoved(ServletRequestAttributeEvent srae) { System.out.println("Attribute removeD. "+srae.getName()) } } Which of the following statements are true about the AccountServletAttributeListener class? Each correct answer represents a complete solution. Choose all that apply. A. Compilation fails because all methods are not implemented from the ServletRequestAttributeListener listener. B. Compilation fails because the incorrect method parameter ServletRequestAttributeEvent is used instead of ServletRequestBindingEvent. C. The attributeReplaced() method must be added to compile this class. D. Compilation is successful, but at runtime it throws IllegalStateException. Answer: A, C 5.Assume that you want to create a thread safe JSP page. Which of the below is correct? A. <%@ page isThreadSafe="false" %> B. <%@ page threadSafe="false" %> C. <%@ page threadSafe="true" %> D. <%@ page isThreadSafe="true" %> Answer: A 6.When a user submits the following form, what is the correct line of code to get the value of request parameter "name" from the ServletRequest object? <html> <body> <form action="/servlet/display"> NamE. <input type="text" name="name"> <p> 3 / 12
Slide 5: The safer , easier way to help you pass any IT exams. <input type="submit" value="Display"> </form> </body> </html> A. String username = request.getParameter("name"); B. String username = request.getValue("name"); C. String username = request.getAttribute("name"); D. String username = request.getParameterValues("name"); Answer: A 7.Which of the following statements are true about the differences between the simple and classic tags? Each correct answer represents a complete solution. Choose all that apply. A. A unique tag handler instance is created for each usage of a simple tag on a page. B. While nesting classic tags, the reference type of the tag must be of type JspTag. C. A classic tag must implement the javax.servlet.jsp.tagext.TagSupport interface. D. While using classic tags, it is required to implement the doStartTag() and doEndTag() meth ods. E. Unlike a classic tag, a simple tag cannot access its parent tag. F. The doEndTag method of classic tags is used to implement iteration and this can be supported by returning the EVAL_BODY_AGAIN. Answer: A, D 8.Assume that you want to use session in your application where session never expires. Which of the below is correct to achieve this? Each correct answer represents a complete solution. Choose all that apply. A. Below declaration in web.xml <session-config> <session-timeout>-1</session-timeout> </session-config> B. A session should always expire. There is no way we can make it as never expire. C. <session-config> <session-timeout>0</session-timeout> </session-config> D. Using servlet API session.setMaxInactiveInterval(-1); E. Using servlet API session.setMaxInactiveInterval(0); Answer: A, C 9.Assume that the below logic exists in servlet's doGet() method: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ... HttpSession session = request.getSession(true); ...//1.} 4 / 12
Slide 6: The safer , easier way to help you pass any IT exams. At //1, which method of HttpSession is used to find whether the session is newly created or not? A. sesson.isCreated(true) B. session.isNewSession() C. session.isNewlyCreated() D. session.isNew() Answer: D 10.Which of the following methods would you use to retrieve the number of parameters present in a request? A. request.getParameters().size() B. Use ServletRequest.getParameterNames() to count the number of parameters programmat ically. C. request.getParameterSize() D. request.getParamCount() Answer: B 11.A servlet is defined in deployment descriptor as below: <servlet> <servlet-name>MyAction<servlet-name> <servlet-class>com.test.MyActionServlet</servlet-class> </servlet> Select all correct mappings for this servlet that apply. Each correct answer represents a complete solution. Choose all that apply. A. <servlet-mapping> <servlet-name>com.test.MyActionServlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> B. <servlet-mapping> <servlet-name>MyActionServlet</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> C. <servlet-mapping> <servlet-name>MyAction</servlet-name> </servlet-mapping> D. <servlet-mapping> <servlet-name>MyAction</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> E. <servlet-mapping> <servlet-name>MyAction</servlet-name> <url-pattern>/Controller</url-pattern> </servlet-mapping> Answer: D 12.Assume that you want to display a common error page when any exceptions occurred in your jsp and 5 / 12
Slide 7: The safer , easier way to help you pass any IT exams. you created an error.jsp for the same. Which of the below is the right error page declaration in a jsp page? A. <%@page errorPage="/common/error.jsp" %> B. <%@include errorPage="/common/error.jsp" %> C. <%@page error="/common/error.jsp" %> D. <%@error page="/common/error.jsp" %> Answer: A 13.Assume that you used the below xml declaration in web.xml to declare data confidentiality and integrity. <user-data-constraint> <transport-guarantee>XXX</transport-guarantee> </user-data-constraint> Which of the below valid values can be replaced with XXX? Each correct answer represents a complete solution. Choose all that apply. A. SECURE B. INTEGRAL C. CONFIDENTIAL D. NONE Answer: B, C, D 14.Assume the following servlet mapping is defined in the deployment descriptor of a Web application: <servlet-mapping> <servlet-name>MyServlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> Which of the following URL requests are serviced by MyServlet? Each correct answer represents a complete solution. Choose all that apply. A. /BankApp/account/logout.do B. /BankApp/Action.do C. /Action.do D. /BankApp/*.do E. /BankApp/do.jsp F. /BankApp/login/do Answer: A, B, C, D 15.You work as a Software Developer for BlueWell Inc. You are creating a Web application for your company. You want to make use of a design pattern that provides the following functionalities: l Hide underlying implementation details, so that the presentation tier components interact directly with business services. l Perform recovery operations. l Intercept remote exceptions. l Cache results locally. l Provide loose coupling between client and system's business services. Which of the following design patterns will you use to accomplish the task? 6 / 12
Slide 8: The safer , easier way to help you pass any IT exams. A. Session Facade B. Intercepting Filter C. Business Delegate D. Model-View-Controller Answer: C 16.Which of the following is used to get a session in the servlet's doGet() method? Each correct answer represents a complete solution. Choose all that apply. A. HttpSession session = request.getHttpSession(); B. HttpSession session = request.getSession(); C. HttpSession session = request.getSession(true); D. HttpSession session = (HttpSession)request.getSession(); E. Session session = request.getSession(); Answer: B, C, D 17.You work as a Software Developer for UcTech Inc. You create a session object and want that it be destroyed if it is not called for 20 minutes. Drag and drop the appropriate statements that you will use to accomplish the task. A. 7 / 12
Slide 9: The safer , easier way to help you pass any IT exams. Answer: A 18.Which of the following statements about the HEAD request method are true? Each correct answer represents a complete solution. Choose all that apply. A. In the HEAD method, the request parameters are transmitted within the body of the request. B. It should not modify the information on the server. C. It is used to request header information. D. It is idempotent. Answer: B, C, D 19.Fill in the required method name in the space provided in the statement below. NotE. Write only the name of the element without (). The findAncestorWithClass() method internally calls the______ method to get further reference. A. getParent Answer: A 20.Which of the following is used to set the HttpSession time out element in web.xml? A. <web-app> ... < session-config> <max-inactive-interval>60</max-inactive-interval> </session-config> ... </web-app> B. <web-app> ... <session-config> <session-timeout>60</session-timeout> </session-config> ... </web-app> C. <web-app> ... <session> <max-inactive-interval>60</max-inactive-interval> </session> ... </web-app> D. <web-app> ... <session> <session-timeout>60</session-timeout> </session> 8 / 12
Slide 10: The safer , easier way to help you pass any IT exams. ... </web-app> Answer: B 21.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 22.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 23.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 24.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 25.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> 9 / 12
Slide 11: The safer , easier way to help you pass any IT exams. </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 26.Assume that you are requested to develop a secured web application. Which of the following would you consider to prevent from hackers? Each correct answer represents a complete solution. Choose all that apply. A. Design application using good design patterns. B. Use HTTPS instead of HTTP. C. Audit the web application code. D. Use firewalls between application and clients. E. Design and develop using popular software methodologies. Answer: B 27.Which of the following web.xml declarations are valid ways of identifying all jsp files under member directory of a bank? Each correct answer represents a complete solution. Choose all that apply. A. <web-resource-collection> <web-resource-name>member</web-resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> <http-method>POST</http-method> </web-resource-collection> B. <resource-collection> <web-resource-name>member</web-resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> 10 / 12
Slide 12: The safer , easier way to help you pass any IT exams. </resource-collection> C. <web-resource-collection> <web-resource-name>member</web-resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> </web-resource-collection> D. <web-resource-collection> <resource-name>member</resource-name> <url-pattern>/bank/member/*.jsp</url-pattern> </web-resource-collection> Answer: A, C 28.Which of the following options is used to get the current session id using EL (Expression Language)? A. ${pageContext.session.id} B. ${session.id} C. ${sessionScope.session.id} D. We cannot get the session id as there exists no session implicit EL object. Answer: A 29.You work as a Software Developer for UcTech Inc. You want to design a pattern with the following characteristics: 1. It may reduce the network traffic by collapsing multiple remote requests into one. 2. It may be implemented as a serializable object, so that it can be moved across the network. Which design pattern should you use to accomplish the task? A. Front Controller B. Service Locator C. Business Delegate D. Intercepting Filter E. Transfer Object Answer: E 30.You have created the following JSP code for displaying the request counter each time when a client requests a jsp page: 1. <html> 2. <body> 3. <% int counter=0; %> 4. The page request is: 5. <%= ++counter %> 6. </body> 7. </html> However, the page always displays The page request is:1 as its result on the screen. Which of the following actions will you take so that the page will display the correct request counter? A. Replace line number 3 with <%! int counter=0; %>. B. Replace line number 3 with <%@ int counter=0; %>. C. Replace line number 5 with <%= ++counter; %>. 11 / 12
Slide 13: The safer , easier way to help you pass any IT exams. D. Replace line number 3 with <%! int counter=0 %>. Answer: A 12 / 12
Slide 14: Welcome to Killtest.com to get this exam pdf and then prepare your exam well. If you have any other questions, plz contact with us in time via this email support@killtest.com . Thanks !

   
Time on Slide Time on Plick
Slides per Visit Slide Views Views by Location