File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Tab support in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tab support in Struts" Watch "Tab support in Struts" New topic

Tab support in Struts

Shashidahanu Iyyanar
Ranch Hand

Joined: Jun 22, 2005
Posts: 37
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

Joined: Apr 14, 2005
Posts: 354
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.

-/a<br />certified slacker...yes, my last name is 'do' - <a href="" target="_blank" rel="nofollow"></a>
Vicky Pandya
Ranch Hand

Joined: Dec 16, 2004
Posts: 148

Look at struts menu project. If that's what you are looking for. Should be very easy to incorporate in your application.

I agree. Here's the link:
subject: Tab support in Struts
It's not a secret anymore!