Today I am going to present the simple template for the website using Struts Titles. This templates have two layout as shown below.


Layout 1 doesn't have menu column on left but layout 2 has. This is suitable for the scenario where you have something like login page initially (Layout 1) then after successfully login you can display the menu on the left (Layout 2).
So our job begin with defining the tiles in struts which can be done in tiles-defs.xml file. Usually we can define four attributes but here as logo is fixed so I have define that in main layout file itself (layout.jsp). So two layouts and two sample pages login and main page is define in tiles-defs.xml file as follow.


1 comment:
nice tile tutorial ... it would have been better if you have compared the JSP Tile Definition and XML Tile Definition. I am not clear about their use.
Is it necessary to write the type attribute in tag of titile as you mentioned above?
Post a Comment