2.1.3.4. Adding Your Own Project Templates

Template is a set of files that serve as a basis to facilitate the creation of a new project. Project templates provide content and structure for a project.

JBoss Developer Studio has a powerful templating capability for creating new and importing existing Struts and JSF projects. This templating facility has a variety of aspects to consider. But, let's start with the most straightforward case and consider the process of creating a template from your existing JSF project.

Let's say you have a project that you want to use as the basis for a new template. Follow these steps to make a template out of it:

  • In the Web Projects view, right-click the project and select JBoss Tools JSF > Save As Template as template

Saving Your Project as Template

Figure 2.19. Saving Your Project as Template


  • In the first dialog box, you can choose a name for the template (defaults to the project name) and confirm what run-time implementation of the project's technology will be used

Define Template Properties

Figure 2.20. Define Template Properties


  • Select Next and you will be sent to a dialog box with your project structure displayed with check boxes. Here you can check only those parts and files in your project directory that should be part of the template

Define Template Properties

Figure 2.21. Define Template Properties


  • At this point, unless you want to designate some extra files as having Velocity template coding inside them, you should click Finish .

That's it. Now, you can use this template with any new or imported project that uses the same run-time implementation as the project you turned into a template.