GTNPORTAL-3484 Commit changes for a page before send response

To merge in master and 3.8.x branches.