I am not clear what you are asking. I assume that if you look at the file maintlayout.jsp you will see a number of tiles:insert tags (like <tiles:insert attribute="viewtitle" /> or <tiles:insert attribute="maintBody" />). These get replaced by the values and jsp pages specified in your tiles:put tags.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com