JSPTabControl

Overview

JSPTabControl is Taglib for manage tabs in your JSP.

With JSPTabControl you can :

  • manage tabs with "pure CSS tabs" technique, by using li and ul HTML elements. On other words, tab header is generated with li and ul HTML elements. So tab control (body and header) and tab page (body and header) can be easily customized with CSS.
  • titles of tab header page can be localized, by using Struts ApplicationResources file properties used in your Struts application WEB or using your own file properties Resource bundle, if you want use JSPTabControl without Struts.
  • select a tab with JAVA code (for example in your action struts).
  • keep last tab selected after posting form.
  • set a state (INVISIBLE, READ-ONLY, FORBIDDEN, ERROR, ...) with JAVA (Server Side) for a particulary tab page :
    • to manage render of tab page (header and body) by using CSS.
    • to execute function javascript swith events (eg : when tab page has FORBIDDEN state, you could execute javascrit message alert "You are not authorized to access this tab!" when user click in this tab page). You can manage any states. States are configurate (Style class and Javascript to execute) into XML file. States can be used for exemple to manage role in your WEB Application.
  • set a state with Javascript (Client side) for a particulary tab page.
  • use EL syntax (see JSTL specification) in JSPTabControl attributes taglib (with, height,...) to evaluate JSP expressions dynamically.

To generate HTML tabs, JSPTabControl has used this example of tabs.

JSPTabControl using

<%@ taglib uri="/WEB-INF/jsptabcontrol.tld" prefix="jsptabcontrol" %>
<html>
  <head>
    <!-- Add CSS for Tab control -->
    <link href="/css/default-jsptabcontrol.css" rel="stylesheet" type="text/css"/>
    <!-- Add Javascript for Tab control -->
    <script type="text/javascript" src="js/jsptabcontrol.js'" ></script>
  </head>
  <body>
    <!-- JSP Tab control -->
    <jsptabcontrol:tabControl name="PERSONNE_TABCONTROL" 
                              width="800px"
                              height="100px" > 
      <jsptabcontrol:tabPage name="IDENTITY_TABPAGE" 
                             title="Identity Tab" 
                             width="100px" >
            ....
      </jsptabcontrol:tabPage>
      <jsptabcontrol:tabPage name="ADRESS_TABPAGE" 
                             title="Adress Tab" >
      ....
      </jsptabcontrol:tabPage>                                                  
    </jsptabcontrol:tabControl>
  </body>
</html>