struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Jouravlev <>
Subject [ANN] Tabbed notebooks in Struts/JSP or in pure JSP with new release of JSP Controls Tag Library
Date Mon, 30 Jan 2006 00:13:53 GMT
Well, finally I found time to encapsulate HTML into some tags. Wendy,
roles work too :-)

To build your own tabbed notebook you need to download tag library
version 0.4 from here:

Please, download samples and examine /tabs directory, it contains the
samples you need. You MUST create a separate JSP file for your tabbed
notebook. This JSP will be used as target for requests. You MUST
process tab change events on input phase, and set/obtain view name on
render phase.

The simplest three-tab notebook looks like this:

<%@ page import="net.jspcontrols.util.Constants"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="" prefix="c" %>
<%@ taglib uri="" prefix="jc" %>
<%@ taglib uri="" prefix="jc-tab" %>

<span id="TigrisTabComponent_def">

<%-- Accept phase, either postback or regular link containing an event --%>

    <jc:handler event="tab1event">
      <% session.setAttribute("tabsetOneCurrentTab", "tab1"); %>
    <jc:handler event="tab2event">
      <% session.setAttribute("tabsetOneCurrentTab", "tab2"); %>
    <jc:handler event="tab3event">
      <% session.setAttribute("tabsetOneCurrentTab", "tab3"); %>

<%-- Prerender phase: store reload address; fixup response header --%>


<%-- Render Phase: render tabs --%>

  <jc-tab:tabcontrol styleClass="tigristabs">
    <jc-tab:tabpage default="true" viewKey="tabsetOneCurrentTab" view="tab1">
      <jc-tab:tabgrip event="tab1event" value="Tab1"/>
          <p>Content of the first tab panel goes here.</p>
    <jc-tab:tabpage viewKey="tabsetOneCurrentTab" view="tab2">
      <jc-tab:tabgrip event="tab2event" value="Tab2"/>
          <p>Content of the second tab panel goes here.</p>
    <jc-tab:tabpage viewKey="tabsetOneCurrentTab" view="tab3"
roles="admin, manager, tabtest1">
      <jc-tab:tabgrip event="tab3event" value="Tab3"/>
          <p>Content of the third tab panel goes here.</p>


Then you include your component into composite page like this:

    <div id="TigrisTabComponent" style="width: 500px;">
      <jsp:include page="tigrisTabComponent.jsp"/>

This is it. It works with Javascript turned off, or in Ajax mode with
Javascript turned on. See live demo here:

Michael Jouravlev.
JSP Controls:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message