Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tab support in Struts

 
Shashidahanu Iyyanar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to implement a page which consists of a number of tabs(tabbed-pane structure).Is this possible in Struts or I have to use Tiles for developing the tab layout?Please reply to this as soon as possible.Thanks in advance.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the short answer is yes, but you'll have to put some effort into leveraging what struts gives you. struts is the controller of your MVC app with selective UI element building supports (essentially custom tags).

building tabs requires passing in the correct criteria to have a particular tab highlighted while the rest are not. the criteria must be calculated and passed into the JSPs. struts has all that you need to do this MANUALLY (calculate criteria and conditional statement tags); in other words, you can write scriptlets or you can use struts action classes and custom tags to do the tabs.

you can use pre-defined tiles attribute value to set which one to highlight (instead of calculating the highlight based on an executed action), but that will be the end of what tiles will be able to help you. as for conditional statements to display the right tabs, i highly recommend using JSTL core taglib instead of the logic taglib provided by struts.
 
Vicky Pandya
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shashidahan,

Look at struts menu project. If that's what you are looking for. Should be very easy to incorporate in your application.
http://demo.raibledesigns.com/struts-menu/index.jsp

Cheers,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic