cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Request attribute from Java class/method

henk_stobbe
DynaMight Leader
DynaMight Leader

Hello,

Just to make sure I understand:

To use a getter in retrieving attribute data, is has to exists in the the class to start with?

and

Using This means you get the "start" value of the getter, and using return option will give you the "end" value?

KR Henk



2 REPLIES 2

JamesKitson
Dynatrace Guru
Dynatrace Guru

Yes, it is true that the method (accessor) you enter there does have to exist. Dynatrace is actually executing that method has part of the process of getting the value - so make sure it truly does only return a value and doesn't actually alter the state of the application.

"This" can be used if you want to access some property or variable of that method the request attribute is configured on. Return value works on the object that is returned by the method. Some details here:

https://www.dynatrace.com/support/help/shortlink/request-attributes-java-dotnet#deep-object-access

dave_mauney
Dynatrace Champion
Dynatrace Champion

We can capture arguments to a method (input values) or the return value (an output value). If the values are strings, you are done at that point. If they are objects, you can use deep object access to call another x methods to get to the string data.

For example, if you get a UserContext object, you might call getUser() to get the User object and then getUserID() to get the user id as a string.

This would be something like ".getUser().getUserID()" to get that information.

Featured Posts