Struts 2 Tabbedpanel Example

Struts » on Oct 27, 2011 { 11 Comments } By Sivateja

Let us see how to work with this struts 2 Tabbedpanel.

jars required

  • commons-logging-1.0.4.jar
  • freemarker-2.3.8.jar
  • ognl-2.6.11.jar
  • struts2-core-2.0.11.jar
  • xwork-2.0.4.jar


files required

  • index.jsp
  • success.jsp
  • web.xml
  • struts.xml

Directory Structure


<META HTTP-EQUIV="Refresh" CONTENT="0;URL=resultAction.action">


<%@ taglib prefix="s" uri="/struts-tags" %>

  <s:head theme="ajax" debug="true"/>


  <s:tabbedPanel id="test" >

  <s:div id="one" label="Tab 1" theme="ajax">  --> First Tab<br><br>

  <s:div id="two" label="Tab 2" theme="ajax">  --> second Tab<br><br>

  <s:div id="three" label="Tab 3" theme="ajax">  --> 3rd Tab<br><br>

  <s:div id="four" label="Tab 4" theme="ajax">  --> 4th Tab<br><br>



package java4s;
import com.opensymphony.xwork2.ActionSupport;
public class LogingEx extends ActionSupport{
    private static final long serialVersionUID = 1L;

      public String execute(){
      return SUCCESS;


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="2.5">


<?xml version="1.0" encoding="UTF-8"?>

"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

    <include file="struts-default.xml"/>
    <package name="a" extends="struts-default">
        <action name="resultAction" class="java4s.LogingEx">
            <result name="success">/success.jsp</result>
            <result name="error">/error.jsp</result>



You Might Also Like

  ::. About the Author .::

Sivateja Kandula - Java/J2EE Full Stack Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can sign-up for the Email Newsletter for your daily dose of Java tutorials.


11 Responses to “Struts 2 Tabbedpanel Example”
  1. Mohammed Vaseem says:

    Am getting error in this program as No tag “tabbedPanel” defined in tag library imported with prefix “s”.
    I downloaded the source code. The code of success.jsp is of another concept but not of tabbedpanel.
    Please help.

  2. Java4s says:


    Gosh, some thing went wrong.
    I have updated the files, please download & check it again.

    Thank a lot vaseem.

  3. Saloni Agarwal says:

    Hello java4s,
    The rar file is showing me garbage data. how can i open this file?

  4. Java4s says:


    Download that .rar file and open with WinRar software. I have tested and working fine from my end.

  5. i have downloaded .rar file and copied content in my project but still it is not showing proper output as u shown above. i new to struts.

  6. Java4s says:

    @durgesh kumawat
    What type of error you are getting…?

  7. sailaja says:

    It is not enough to paste the jar files in lib folder.You need to add all 5 jar files to your project build path (right click on project stuts-tabbed-paneEx -select bulid path-select configure build path-click add jars-select all jar iles under you project’s lib-click ok)

  8. Rajesh Rana says:

    thanks good job easy to learn to freasher

  9. Tamizharasi says:

    Very useful for the beginners.Thank you so much..

  10. Jagannath says:

    Retrieving menu and submenu from database.
    how can use hashmap here? and create menu and submenu.

  11. Umesh Hemant Annegirikar says:

    Very good working example i like it its running successfully


By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Spring Boot Hibernate Spring
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2024 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.