In modern society, SUN 310-083 certificate has an important impact on your future job, your promotion and salary increase. Also it can make a great deal of difference in your career.
Here, BraindumpsQA's 310-083 exam materials will help you pass your SUN 310-083 certification exam and get SUN certification certificate. Our exam materials are written to the highest standards of technical accuracy. And the 310-083 exam questions and answers are edited by experienced IT experts and have a 99.9% of hit rate.
BraindumpsQA provides you with the most excellent and latest 310-083 PDF Version & Software version exam dumps. The Software version exam material is a test engine that simulates the exam in a real exam environment, which can help you test your level of knowledge about 310-083 exam.
If you have no good idea to prepare for SUN 310-083 exam, BraindumpsQA will be your best choice. Our 310-083 exam questions and answers are the most accurate and almost contain all knowledge points. With the help of our exam materials, you don't need to attend other expensive training courses and just need to take 20-30 hours to grasp our 310-083 exam questions and answers well.
After you purchased our BraindumpsQA's 310-083 exam materials, we offer you free update for one year. We will check the updates of exam materials every day. Once the materials updated, we will automatically free send the latest version to your mailbox.
In addition, we offer you free demo. Before you decide to buy our BraindumpsQA's 310-083 exam materials, you can try our free demo and download it. If it is useful to you, you can click the button 'add to cart' to finish your order.
310-083 Online Test Engine supports Windows / Mac / Android / iOS, etc., because it is the software based on WEB browser.
BraindumpsQA guarantees no help, full refund. If you fail the exam, you just need to send the scanning copy of your examination report card to us. After confirming, we will quickly give you FULL REFUND of your purchasing fees.
Easy and convenient way to buy: Just two steps to complete your purchase, we will send the 310-083 braindumps to your mailbox quickly, later you can check your email and download the attachment.
SUN Sun Certified Web Component Developer for J2EE 5 Sample Questions:
1. Which two classes or interfaces provide a getSession method? (Choose two.)
A) javax.servlet.http.HttpSessionBindingEvent
B) javax.servlet.http.HttpServletRequest
C) javax.servlet.http.HttpSessionContext
D) javax.servlet.http.HttpSessionAttributeEvent
E) javax.servlet.http.HttpServletResponse
2. Your web site has many user-customizable features, for example font and color preferences on web pages. Your IT department has already built a subsystem for user preferences using Java SE's lang.util.prefs package APIs and you have been ordered to reuse this subsystem in your web application. You need to create an event listener that stores the user's Preference object when an HTTP session is created. Also, note that user identification information is stored in an HTTP cookie.
Which partial listener class can accomplish this goal?
A) public class UserPrefLoader implements HttpSessionListener {
public void sessionInitialized(HttpSessionEvent se) {
MyPrefsFactory myFactory = (MyPrefsFactory)
se.getServletContext().getAttribute("myPrefsFactory");
User user = getUserFromCookie(se);
myFactory.setThreadLocalUser(user);
Preferences userPrefs = myFactory.userRoot();
se.getHttpSession().setAttribute("prefs", userPrefs);
}
// more code here
}
B) public class UserPrefLoader implements HttpSessionListener {
public void sessionCreated(HttpSessionEvent se) {
MyPrefsFactory myFactory = (MyPrefsFactory)
se.getServletContext().getAttribute("myPrefsFactory");
User user = getUserFromCookie(se);
myFactory.setThreadLocalUser(user);
Preferences userPrefs = myFactory.userRoot();
se.getSession().setAttribute("prefs", userPrefs);
}
// more code here
}
C) public class UserPrefLoader implements SessionListener {
public void sessionCreated(SessionEvent se) {
MyPrefsFactory myFactory = (MyPrefsFactory)
se.getContext().getAttribute("myPrefsFactory");
User user = getUserFromCookie(se);
myFactory.setThreadLocalUser(user);
Preferences userPrefs = myFactory.userRoot();
se.getSession().addAttribute("prefs", userPrefs);
}
// more code here
}
D) public class UserPrefLoader implements SessionListener {
public void sessionInitialized(SessionEvent se) {
MyPrefsFactory myFactory = (MyPrefsFactory)
se.getServletContext().getAttribute("myPrefsFactory");
User user = getUserFromCookie(se);
myFactory.setThreadLocalUser(user);
Preferences userPrefs = myFactory.userRoot();
se.getSession().addAttribute("prefs", userPrefs);
}
// more code here
}
3. Which method must be used to encode a URL passed as an argument to
HttpServletResponse.sendRedirect when using URL rewriting for session tracking?
A) ServletResponse.encodeRedirectURL
B) HttpServletResponse.encodeRedirectURL
C) HttpServletResponse.encodeURL
D) ServletResponse.encodeURL
4. Given:
1 0. public void service(ServletRequest request,
1 1. ServletResponse response) {
1 2. ServletInputStream sis =
1 3. // insert code here
1 4. }
Which retrieves the binary input stream on line 13?
A) request.getWriter();
B) request.getResourceAsStream();
C) request.getInputStream();
D) request.getResourceAsStream(ServletRequest.REQUEST);
E) request.getReader();
5. 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?
A) <jsp:useBean id="com.example.Product" />
< jsp:setProperty name="product" property="*" />
B) <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>
C) <jsp:useBean id="product" class="com.example.Product" />
$ {product.name = param.i1}
$ {product.price = param.i2}
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>
Solutions:
Question # 1 Answer: A,B | Question # 2 Answer: B | Question # 3 Answer: B | Question # 4 Answer: C | Question # 5 Answer: B |