Cylinder Subdivision Surface Modifier Problem - Smooth Shading
To subdivide a cylinder with a Subsurf modifier, you'll need to add holding edges to where you want the edges to be sharp.  This can be achieved by using the bevel tool.

While in edit mode, Alt-select the edges that you would like to be sharp, then press Ctrl-B to set a bevel width.  I set the amount of Segments to '2' and a Profile of '1' so that if I need to remove my holding edges, my original edge will be where I originally had it before beveling.


Afterwards, you can add additional ring-cuts on the flat surfaces (Ctrl-R) to avoid any visible triangulation in the rendered result: