Showing posts with label response properties. Show all posts
Showing posts with label response properties. Show all posts

Thursday, January 31, 2013

On redirect removing properties from request


Removing parameters from request when redirecting in commerce is an interesting problem and this is not something that needs to be implemented in regular flows.
In the scenario when you have logonId and logonPassword  passed into form post, removing logonId/logonPassword from request properties in perform execute or creating a new request property and setting in command context does not fix the issue.

responseProp.put(ECConstants.EC_VIEWTASKNAME,ECConstants.EC_GENERIC_REDIRECTVIEW);
responseProp.put(ECConstants.EC_REDIRECTURL,"RedirectViewSample");
setResponseProperties(responseProp);

Solution: OverRide setViewInputProperties and remove the properties from request to the redirect view.

   public void setViewInputProperties(TypedProperty reqProperties){
        reqProperties.remove("logonId");
        reqProperties.remove("logonPassword");       
        this.viewReqProperties = reqProperties;
    }