Valid Comm-Dev-101 Dumps shared by ExamDiscuss.com for Helping Passing Comm-Dev-101 Exam! ExamDiscuss.com now offer the newest Comm-Dev-101 exam dumps, the ExamDiscuss.com Comm-Dev-101 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com Comm-Dev-101 dumps with Test Engine here:
Given the following snippet: server.append( ' Show ' ,function(req,res,next) { According to SFRA, which option can a Developer use to complete the code above and provide data to the response using a controller?
Correct Answer: A
SFRA ' s response object provides thesetViewData()method specifically for adding data to the view-data object that will be available during rendering. Therefore, option A follows the supported controller pattern: callres.setViewData()with the additional object, render the template, and then invokenext()to continue the middleware chain. Salesforce ' s SFRA documentation explains thatsetViewData(data)adds or merges data into the response ' s view-data object. This behavior is particularly important for an appended route because earlier middleware may already have established view data.setViewData()allows the appended function to add its contribution without replacing the response object ' s internal handling. Directly assigningres.viewData, as shown in option B, bypasses the supported response API and is not the documented SFRA mechanism. Option C is also invalid because route appending expects a middleware function; data cannot be supplied by chaining an object through.append()after rendering. This pattern is central to cartridge extensibility because multiple middleware functions can progressively enrich a response while preserving previously established data and route behavior. Study Guide reference:Application Development - SFRA controllers, response objects, middleware chains, setViewData(), and template rendering.