Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GIAC GSNA Exam - Topic 6 Question 38 Discussion

Posted by Roslyn on Dec 22, 2023 at 05:26 PM

You work as a programmer for uCertify.Inc. You have a session object named session1 with an attribute named Attribute1, and an HttpSessionBindingEvent object binding1 bound to session1. Which of the following will be used to retrieve Attribute1?

Each correct answer represents a complete solution. Choose all that apply.

Suggested Answer: A, D

The following two code are used to retrieve Attribute1:

1.Object obj=session1.getAttribute('Attribute1'); The getAttribute() method is used to retrieve the bound object with the specified

name in this session, or null if no object is bound under the name.

2.Object obj=binding1.getSession().getAttribute('Attribute1'); The getSession() gets the current valid session associated with this

request.

Answer E and C are incorrect. These code are invalid because the getAttribute() method returns an object instead of a long object or

a String object.

Answer B is incorrect. The HttpSessionBindingEvent object cannot use the getAttribute() method.


Get Premium GSNA Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
17 comments · newest first
AN
Annabelle 10 months ago
Why would you use binding1 for this? Sounds confusing.
ZA
Zana 11 months ago
Definitely A and D, no doubt about it!
TA
Tasia 11 months ago
Wait, can you use binding1.getAttribute? Seems off.
CE
Celestina 11 months ago
I think E is also valid.
DA
Darrin 11 months ago
A and D are correct!
RO
Rolland 11 months ago
I feel like option C might be wrong because it uses session1 directly, but I can't recall if that's a valid way to access the attribute.
LA
Lavera 12 months ago
I practiced a similar question where we had to retrieve session attributes, and I think options D and E should work too.
JE
Jeanice 12 months ago
I'm not sure about option B; I don't remember if getAttribute can be called directly on binding1.
SH
Shawnda 12 months ago
I think option A is correct since it uses binding1 to get the session and then retrieves the attribute.
AR
Ardella 1 year ago
This is a good test of our understanding of session management in Java. I think the key is to focus on the relationship between the session object and the HttpSessionBindingEvent object, and how to properly access the attributes.
SI
Silvana 1 year ago
I'm not entirely sure about this one. I'll need to review my notes on session management and HttpSessionBindingEvent to make sure I understand the concepts before attempting to answer.
SH
Shawn 1 year ago
Okay, I've got this. The correct answers are D and E - using the session1 object to directly retrieve the 'Attribute1' attribute. The other options don't seem to make sense given the information provided.
LA
Laurel 1 year ago
Hmm, I'm a bit confused about the different objects and how they relate to each other. I'll need to carefully read through the options and think about which one makes the most sense for retrieving the attribute.
LA
Lai 1 year ago
This looks like a straightforward question about retrieving an attribute from a session object. I think the key is to understand the relationship between the session object, the HttpSessionBindingEvent object, and how to properly access the attribute.
WI
Winfred 1 year ago
Ah, I see what they're getting at. Tactical ploys are often associated with distributive bargaining, but they can also be used in integrative negotiations to gain insights into the other party's interests. I'll be sure to address that in my response.
KE
Keneth 1 year ago
I think SFA could be the right answer since it specifically focuses on managing sales and improving the customer pipeline.
JO
Johna 1 year ago
This seems straightforward - I think the answer is to use Cloud Build to include the release version tag in the application image.
0/2000 characters

Save Cancel