IT-Tests's products can not only help customers 100% pass their first time to attend SUN certification 310-085 exam, but also provide a one-year of free online update service for them, which will delivery the latest exam materials to customers at the first time to let them know the latest certification exam information. So IT-Tests.com is a very good website which not only provide good quality products, but also a good after-sales service.
The site of IT-Tests.com is well-known on a global scale. Because the training materials it provides to the IT industry have no-limited applicability. This is the achievement made by IT experts in IT-Tests.com after a long period of time. They used their knowledge and experience as well as the ever-changing IT industry to produce the material. The effect of IT-Tests.com's SUN 310-085 exam training materials is reflected particularly good by the use of the many candidates. If you participate in the IT exam, you should not hesitate to choose IT-Tests.com's SUN 310-085 exam training materials. After you use, you will know that it is really good.
If you choose the help of IT-Tests, we will spare no effort to help you pass the exam. Moreover, we also provide you with a year of free after-sales service to update the exam practice questions and answers. Do not hesitate! Please select IT-Tests, it will be the best guarantee for you to pass 310-085 certification exam. Now please add IT-Tests.com to your shopping cart.
Exam Code: 310-085
Exam Name: SUN (JavaServer Pages and Servlet Developer Certified Expert Exam)
IT-Tests.com's SUN 310-085 exam training materials not only can save your energy and money, but also can save a lot of time for you. Because the things what our materials have done, you might need a few months to achieve. So what you have to do is use the IT-Tests.com SUN 310-085 exam training materials. And obtain this certificate for yourself. IT-Tests.com will help you to get the knowledge and experience that you need and will provide you with a detailed SUN 310-085 exam objective. So with it, you will pass the exam.
310-085 (JavaServer Pages and Servlet Developer Certified Expert Exam) Free Demo Download: http://www.it-tests.com/310-085.html
NO.1 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());
}
}
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
SUN answers real questions 310-085 certification training 310-085 braindump 310-085 questions
NO.2 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.}
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
SUN certification 310-085 310-085 pdf
NO.3 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
SUN test 310-085 study guide 310-085 310-085
NO.4 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
SUN 310-085 310-085 310-085 310-085
NO.5 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
SUN pdf 310-085 braindump 310-085 310-085 310-085 original questions
NO.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>
<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
SUN 310-085 certification 310-085 exam simulations 310-085
NO.7 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
SUN 310-085 test questions 310-085 certification training 310-085 practice test
NO.8 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
SUN demo 310-085 questions 310-085 310-085 exam simulations 310-085 original questions 310-085 braindump
NO.9 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
SUN test 310-085 study guide 310-085 exam simulations 310-085 310-085
NO.10 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
SUN 310-085 certification training 310-085 certification 310-085 pdf 310-085
NO.11 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?
A. Session Facade
B. Intercepting Filter
C. Business Delegate
D. Model-View-Controller
Answer: C
SUN 310-085 310-085 answers real questions 310-085 310-085
NO.12 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
SUN certification 310-085 310-085 pdf 310-085 310-085 original questions
NO.13 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
SUN 310-085 certification training 310-085 certification 310-085 exam simulations
NO.14 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
SUN test 310-085 310-085 demo 310-085 original questions
NO.15 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
SUN demo 310-085 exam dumps 310-085
NO.16 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; %>.
D. Replace line number 3 with <%! int counter=0 %>.
Answer: A
SUN exam simulations 310-085 questions 310-085 study guide
NO.17 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
SUN questions 310-085 310-085 questions 310-085 braindump
NO.18 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>
</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
SUN 310-085 310-085
NO.19 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
SUN 310-085 310-085 310-085 original questions 310-085 certification 310-085 test
NO.20 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
SUN certification 310-085 310-085 310-085 dumps
NO.21 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
SUN 310-085 310-085 310-085 310-085 310-085 exam
NO.22 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>
...
</web-app>
Answer: B
SUN braindump 310-085 310-085 310-085 310-085 certification
NO.23 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.
Answer: A
SUN 310-085 exam dumps 310-085 310-085 certification
NO.24 Assume that you want to display a common error page when any exceptions occurred in your jsp and
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
SUN test 310-085 certification training 310-085 exam simulations 310-085
NO.25 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
SUN 310-085 310-085 practice test
NO.26 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
SUN 310-085 exam simulations 310-085 answers real questions 310-085
NO.27 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
SUN exam dumps 310-085 exam dumps 310-085 310-085
NO.28 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
SUN questions 310-085 310-085 study guide
NO.29 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
SUN 310-085 dumps 310-085 exam
NO.30 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
SUN 310-085 310-085 310-085 original questions 310-085 310-085 answers real questions
There are many ways to help you prepare for your SUN 310-085 exam. IT-Tests.com provide a reliable training tools to help you prepare for your SUN 310-085 exam certification. The IT-Tests.com SUN 310-085 exam materials are including test questions and answers. Our materials are very good sofeware that through the practice test. Our materials will meet all of theIT certifications.
没有评论:
发表评论