SharePoint 2007: how deploy pages and web parts via feature

I'm working on a project and I have to deploy web part pages via feature.

In SharePoint 2010 it is possible to create the pages and export the site in a .wsp, but SharePoint 2007 the export was done in .stp files.

So the solution is:

  1. create the feature and the related module;
  2. in the web part page, export the web parts in the page in multiple .webpart files, as described in the blog article Exporting and Importing a Web Part through the SharePoint UI;
  3. include the .webparts file in the module, as described in the blog post Quick Tip: Provisioning Web Parts to a Page.