Although it is not advisable for markup of any kind to be generated by the servlets. Servlets should serve as controllers, not views. The servlets should perform their processing, then forward to a JSP to render the view. The CSS would be in the JSP.