What is the correct way to represent template classes with UML?

Solution 1:

Normal rectangle with a dotted rectangle in the top right corner, to represent the template parameter. Something like this:

           .......               
___________:  T  :
|          :.....:
|              |
|  ClassName   |
|              |
|______________|

Solution 2:

A more useful approach is to use a UML Classifier for the Template. This is a UML Element that represents an extension to the UML notation. If your tool supports profiles create the Classifier within one. Define the Classifier for the Template, and include the properties and methods from the template, then instead of using the standard class notation, use the Classifier you have created for each Class that uses the template. This would be correct usage of the UML for Templates.