Valid AD0-E123 Dumps shared by ExamDiscuss.com for Helping Passing AD0-E123 Exam! ExamDiscuss.com now offer the newest AD0-E123 exam dumps, the ExamDiscuss.com AD0-E123 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com AD0-E123 dumps with Test Engine here:
Review the following HTL code snippet: <div data-sly- use.testComponent='${com.adobe.core.models.TestComponent'@ testParam='testValue'}'></div> Which two approaches correctly read the value of testParam in Sling model? (Choose two.)
Correct Answer: B,C
In Sling Models, annotations are used to map request parameters, attributes, and properties to fields in Java classes. When an HTL script passes parameters to a Sling Model, the Sling Model can use annotations to access these parameters. Option B uses the@RequestAttributeannotation which allows the Sling Model to retrieve an attribute that has been set on the Sling HTTP request object. This is a valid approach to read the 'testParam' if it has been set as a request attribute. Option C uses the@Injectannotation with thenameattribute specifying the name of the parameter to inject. This is another valid approach to read the 'testParam' from the request. Option A is incorrect because@Namedis not the correct annotation for retrieving request attributes or parameters. Option D is incorrect because there is no@Propannotation in Sling Models; it's likely confused with the @Propertyannotation which is not the correct one for this context either.