To ensure SFRA best practices and protect against request forgery, the developer introduced CSRF token generation in the customer address form:
<form ... action = "submit">
<input name ="${dw.web.CSRFProtection.getTokenName()}"
value = "${dw.web.CSRFProtection.generateToken()">
...
<the rest of the Form fields>
...
</form>
To implement CSRF protection when the form is submitted, the developer needs to introduce the CSRF validation using one or both of these methods as applicable:
validateRequest
validateAjaxRequest
Where in the code does the developer need to add this CSRF validation check?
A. In the controller function that handles the submitted form
B. In the controller function that displays the form
C. In the middleware chain of the controller post route
D. In the model function that persists the form data
正解:C
質問 2:
A client sells its products in North America, Europe, and Asia, and has a B2C Commerce Site for each of these markets. The client receives three area-specific snippets of analytics code by a third-party provider to insert in the sites.
How should the developer configure an instance to allow the merchant to independently insert and update these snippets?
A. Use ISML conditional tags to add the snippet into the codebase.
B. Configure a new Service Profile with the provided snippet of code.
C. Create a new "HTML" attribute in the SitePreference object type.
正解:C
質問 3:
A developer is asked to write a log containing the ID and name of the product with a variable named myProduct.
Which snippet of code should be used?
A. Logger.warn('The current producto is %s with name %s'), context(myProduct.getID(), myProduct.getName());
B. Logger.warn('The current producto is {0} with name {1}'), context(myProduct.getID(), myProduct.getName());
C. Logger.warn('The current producto is ${myProduct.getID()} with name ${myProduct.getName()}');
D. Logger.warn('The current producto is {0} with name {1}', myProduct.getID(), myProduct.getName());
正解:D
質問 4:
Multiple shoppers report slow performance on the Product Details Page.
Which tool can a developer use to view average response times for the Product-Detail controller route?
A. URL Request Analyzer
B. Request Logs
C. Pipeline Profiler
正解:C
質問 5:
A Digital Developer needs to store information temporarily and decides to create a custom object.
Which code creates a custom object?
A. CustomObject.createCustomObject(CustomObjectType,primaryKey);
B. CustomObject.createCustomObject(primaryKey,CustomObjectType);
C. CustomObjectMgr.createCustomObject(CustomObjectType,primaryKey)
D. CustomObjectMgr.createCustomObject(primaryKey);
正解:A
質問 6:
A developer needs to perform the same additional checks before completing multiple routes in a custom controller, in order to decide whether to render a template or redirect the user to a different page.
According to SFRA best practices, what is the correct approach to improve code reusability in this scenario7
A. Append a new function to all the existing routes with the server module.
B. Replace the existing routes by creating a controller in separate new cartridge.
C. Define a new middleware function and use it in the existing routes.
D. Use the superModule property in the existing routes to extend their functionality.
正解:C
質問 7:
A client that sells to multiple countries in Europe needs to disable Apple Pay for Denmark.
Which Business Manager module is used to achieve this requirement?
A. Payment Processors
B. Apple Pay
C. Locale Payments
D. Payment Methods
正解:C
Shimazaki -
Pass4Testお陰様でいい問題集を出会いました。感謝です。