Web engineering constitutes the employment of an engineering approach to the development of Web applications. Its main teaching objectives are for students to learn what an engineering approach represents and how measurement can be applied. This paper presents the application of the Cognitive Flexibility Theory as an instructional theory to teach Web Engineering principles. Results obtained over the last three years suggest that the CFT seems valuable for teaching Web engineering, as indicated by the boxplots of exam marks (regarding the Web engineering part of the exam). .