Struts displaytag tutorial: Sort / Pagination data using displaytag in Struts

Struts display tag library is an open source suite of custom tags that provide high-level web presentation patterns which will work in an MVC model. The library provides a significant amount of functionality while still being easy to use. Displaytag can handle column display, sorting, paging, cropping, grouping, exporting, smart linking and decoration of a table in a customizable XHTML style.

In the following example we will see how to dispaly data using display tag and to do pagination and sorting. We will use Eclipse as an IDE for our example.

Step 1: Create Eclipse dynamic web project and copy JAR files

Start Eclipse and goto File -> New -> Project -> Dynamic Web Project
struts dynamic web project

Following is the list of required JAR files to be added in Java Class Path of your project. Download displaytag JAR files from http://displaytag.sourceforge.net/1.2/download.html.

displaytag-jar-file-list

Step 2: Create Action, Form and Bean class

Once the project is created, create 3 java files ForbesData, UserAction and UserForm in package net.viralpatel.struts.displaytag.
struts-displaytag-new-java

Copy following content into ForbesData.java file.

package net.viralpatel.struts.displaytag;

import java.util.ArrayList;

public class ForbesData {
	private int rank;
	private String name;
	private int age;
	private double netWorth;

	public ForbesData() {

	}
	
	public ForbesData(int rank, String name, int age, double netWorth) {
		this.rank = rank;
		this.name = name;
		this.age = age;
		this.netWorth = netWorth;
	}
	public ArrayList<ForbesData> loadData() {
		ArrayList<ForbesData> userList = new ArrayList<ForbesData>();
		userList.add(new ForbesData(1, "William Gates III", 53, 40.0));
		userList.add(new ForbesData(2, "Warren Buffett", 78, 37));
		userList.add(new ForbesData(3, "Carlos Slim Helu &amp; family", 69, 35));
		userList.add(new ForbesData(4, "Lawrence Ellison", 64, 22.5));
		userList.add(new ForbesData(5, "Ingvar Kamprad &amp; family", 83, 22));
		userList.add(new ForbesData(6, "Karl Albrecht", 89, 21.5));
		userList.add(new ForbesData(7, "Mukesh Ambani", 51, 19.5));
		userList.add(new ForbesData(8, "Lakshmi Mittal", 58, 19.3));
		userList.add(new ForbesData(9, "Theo Albrecht", 87, 18.8));
		userList.add(new ForbesData(10, "Amancio Ortega", 73, 18.3));
		userList.add(new ForbesData(11, "Jim Walton", 61, 17.8));
		userList.add(new ForbesData(12, "Alice Walton", 59, 17.6));
		userList.add(new ForbesData(12, "Christy Walton &amp; family", 54, 17.6));
		userList.add(new ForbesData(12, "S Robson Walton", 65, 17.6));
		userList.add(new ForbesData(15, "Bernard Arnault", 60, 16.5));
		userList.add(new ForbesData(16, "Li Ka-shing", 80, 16.2));
		userList.add(new ForbesData(17, "Michael Bloomberg", 67, 16));
		userList.add(new ForbesData(18, "Stefan Persson", 61, 14.5));
		userList.add(new ForbesData(19, "Charles Koch", 73, 14));
		userList.add(new ForbesData(19, "David Koch", 68, 14));
		userList.add(new ForbesData(21, "Liliane Bettencourt", 86, 13.4));
		userList.add(new ForbesData(22, "Prince Alwaleed Bin Talal Alsaud", 54, 13.3));
		return userList;
	}
	public int getRank() {
		return rank;
	}
	public void setRank(int rank) {
		this.rank = rank;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public double getNetWorth() {
		return netWorth;
	}
	public void setNetWorth(double netWorth) {
		this.netWorth = netWorth;
	}
}

Copy following content into UserForm.java

package net.viralpatel.struts.displaytag;

import java.util.ArrayList;

public class UserForm extends org.apache.struts.action.ActionForm {

	private ArrayList<ForbesData> forbesList;

	public ArrayList<ForbesData> getForbesList() {
		return forbesList;
	}

	public void setForbesList(ArrayList<ForbesData> forbesList) {
		this.forbesList = forbesList;
	}
}

Copy following content into UserAction.java

package net.viralpatel.struts.displaytag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class UserAction extends Action {
	
    private final static String SUCCESS = "success";
	
	public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        UserForm userForm = (UserForm) form;
        ForbesData actorData = new ForbesData();
        userForm.setForbesList(actorData.loadData());
        return mapping.findForward(SUCCESS);
    }
      
}

Step 3: Create JSPs, struts-config.xml and web.xml

Create index.jsp and user.jsp in WebContent folder and struts-config.xml and web.xml in WebContent/WEB-INF folder.
struts-displaytag-web-xml-jsp

Copy following content into appropriate files.

index.jsp

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<jsp:forward page="userAction.do"/>

user.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://displaytag.sf.net" prefix="display" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>The World's Billionaires 2009</title>
        <link href="css/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <h2>The World's Billionaires 2009 - Forbes List</h2>
        <display:table export="true"  id="data" 
        			name="sessionScope.UserForm.forbesList" 
        			requestURI="/userAction.do" pagesize="10" >
            <display:column property="rank" title="Rank" sortable="true"   />
            <display:column property="name" title="Name" sortable="true"  />
            <display:column property="age" title="Age" sortable="true"  />
            <display:column property="netWorth" title="Net worth ($BIL)" 
            		sortable="true"  />
        </display:table>
    </body>
</html>

struts-config.xml

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

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">


<struts-config>
    <form-beans>
        <form-bean name="UserForm" 
        	type="net.viralpatel.struts.displaytag.UserForm"/>
    </form-beans>
    
    <global-exceptions>
    
    </global-exceptions>

    <global-forwards>
        <forward name="welcome"  path="/Welcome.do"/>
    </global-forwards>

    <action-mappings>
        <action input="/" name="UserForm" path="/userAction" 
        	scope="session" type="net.viralpatel.struts.displaytag.UserAction">
            <forward name="success" path="/user.jsp" />
        </action>
        <action path="/Welcome" forward="/welcomeStruts.jsp"/>
    </action-mappings>
    
    <message-resources parameter="com/vaannila/ApplicationResource"/>
  
</struts-config>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<servlet>
		<servlet-name>action</servlet-name>
		<servlet-class>
			org.apache.struts.action.ActionServlet
		</servlet-class>
		<init-param>
			<param-name>config</param-name>
			<param-value>/WEB-INF/struts-config.xml</param-value>
		</init-param>
		<init-param>
			<param-name>debug</param-name>
			<param-value>2</param-value>
		</init-param>
		<init-param>
			<param-name>detail</param-name>
			<param-value>2</param-value>
		</init-param>
		<load-on-startup>2</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>action</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>
	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
</web-app>

Step 4: Execute the project

We are done with the project. Now execute the project in eclipse or create a WAR file and run it in Tomcat.

struts-displaytag-example



104 Comments

  • Mamata 26 August, 2010, 16:34

    Hi ,can any body please let me know how to pass one reference variable using display tag when calling javascript method,Here my code is like:-

    ——–>Here if i’ll do like this i used to get always 1st row Value.Even tried removing ” mark also but that time my javascript method not able to call.Somebody could help me to work out.

  • Anil 3 September, 2010, 10:44

    Hello,
    Can anyone tell me how to dynamically add a style to the column based on some condition. I have seen addRowClass() method and overridden in the decorator but the style is added to the whole row and not to the corresponding cell. Can anyone tell me how to solve this?

  • mehar 14 September, 2010, 16:02

    iam getting Nothing found to display please suggest what should be done

  • bhupesh 15 September, 2010, 11:48

    Hi,

    Someone please help me on showing items in grid format than list.
    it create table rows and columns and thus generate list view.

    Thanks a lot,

    Bhupesh

  • Rudresh 18 October, 2010, 11:47

    can you please let me hos to implement same in struts2 only

  • Rudresh 18 October, 2010, 11:59

    <display:table export="true" id="data"
    13 name="sessionScope.UserForm.forbesList"
    14 requestURI="/userAction.do" pagesize="10"

    Please explain me how to define this in Struts2, we have not used Form in struts 2

  • Rudresh 18 October, 2010, 15:12

    Hi Viral, this looks like an excellent tutorial, and i am able to in struts 1, Unfortunately I’m using Struts 2. Do you have any advice on how I’d implement this in Struts2?
    Please i am glad if you have any answer
    Thanks!

  • Rudresh 20 October, 2010, 16:51

    Please help me on struts2, i am not able to get anything in struts2 even it doesnt show any error also and also nothing displaying, please give 1 example,

  • Rudresh 27 October, 2010, 8:57

    Is any body looking my post

  • raghavendra 2 November, 2010, 12:32

    Hi
    Thanks for the nice post. i have a different requirement. Display tag loads all the records from the database and then displays it. If i have around 10,000 records and it takes lot of time for each hit using display tag. Is there any thing like loading the configured page size records only each time.

  • Shilpa 29 November, 2010, 10:35

    Hi Viral,
    I am using display:table and display:column to display reports fetched from database.
    Please let me know how to set width to the display:column ? I tried using style: width.. but it does not work.
    Thanks in advance.

    • Neil 11 November, 2011, 2:03

      Did you get any solution for specifying column width. I am facing the same problem?

  • Saket 14 December, 2010, 14:14

    Hi viral
    I am getting folllowing exception <input [ServletException in:/desktop/polaris_manage_component.jsp] org/apache/commons/beanutils/NestedNullException'
    folllowing is my code

    component is list of ComponentBean and it has compDesc as attribute

  • Kalyan Kumar 14 December, 2010, 17:20

    Thanks Viral… SuperB code…. Kekkkkkkkkkkkkkkkkaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

  • Hitesh 17 December, 2010, 12:21

    Hi Viral,
    Nice tutorial.
    I have added checkbox in each row and i want when user click on checkbox that row shud b highlighted.Can u help me out in this?

  • kalyan kumar 18 January, 2011, 11:19

    Hi viral, i am trying to add a button to each row and if user clicks on button i want the values in the clicked row.

    Please help me how to do it.

    THanks in advance

  • Ed 26 January, 2011, 0:44

    Viral, Thank you for the selfless work that you do. I am having proble displaying the first page applying the css properties. But after I click the next botton, the properties are then applied. The first time the report is displayed it plain with no font or color applied but afer clicking on the pagination, then the report begin to appear correctly apply in the css properties. Any idea what I am doing wrong.?

  • Ed 26 January, 2011, 0:49

    Viral, At first display, the report does not apply css properties until after clicking on the pagination images. Any idea of what I am doing wrong.
    Thank you in advance

  • Robert 7 February, 2011, 3:32

    Hi, I have followed your instructions exactley and I have all the appropriate jars in my projects classpath however, I am getting an exception when I try and run it on my server. Can you please tell me what I am missing thanks the exception is below. I have all the struts jars in my classpath as well but it says the org.apache.struts.action.ActionServlet class is not found how can that be when I have the struts jar in my project?

    Feb 6, 2011 4:27:26 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: Feb 6, 2011 4:27:27 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:pagertaglibtest’ did not find a matching property.
    /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts-examples-1.3.10.1/WEB-INF/lib/struts-core-1.3.10.jar!/org/apache/struts/chain/chain-config.xml
    SEVERE: Servlet /StrutsDisplayTag threw load() exception
    java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
    Feb 6, 2011 4:27:28 PM org.apache.coyote.http11.Http11Protocol start
    Feb 6, 2011 4:27:30 PM org.apache.catalina.core.ApplicationDispatcher invoke

  • Shiva Kumar 24 February, 2011, 11:32

    how to add buttons using display tags(like view ,edit to view/edit the particular record of the pagination)

  • Deepak 6 July, 2011, 14:06

    Hey,
    I need to pass the value of display tag column to a javascript function without using JSTL.Is there any alternative?

  • hasini 7 October, 2011, 7:42

    Hi,
    This is working very nice. But i have small problem i am using displaytag for search when i load search page first time list is empty that time display tag is showing nothing to disply and that too i have 3 different results of lists r there. that time it is showng 3 times nothing to display.

  • rohit 5 December, 2011, 12:07

    thank u very much viral…

  • Gurmeet 9 December, 2011, 7:22

    hello if I apply header and footer to the webpage the export feature does not work. Looks like the header interjects with the display tag export feature. I am talking about the header for the webpage and not to the table columns. I am wokring with Eclipse IDE and using struts2

  • Gurmeet 9 December, 2011, 7:32

    hello again also my display tag pagination project at least more than 10 display columns are with no data(null) and I do not want to show those columns in the display.
    I am using a list and method from actions class in the jsp page. again my project is in struts2 and works fine without header applied using directive. But shows all columns including the ones with no data empty. I want to hide those columns from display.

  • skumar 2 January, 2012, 11:12

    Nice one .
    How i can implement the pagination using ajax tag for the above example.
    can u suggest me…….

  • hari 6 January, 2012, 12:49

    Hi,

    Can any one help to do the fixedheader(header should not scroll) with display:table?

    Please provide me the sample code.

    Thanks & Regards,
    Hari

  • Vikash Srivastava 16 January, 2012, 12:47

    Hi,
    when we call second page then it show error.
    how can we resolve it.
    First time–http://localhost:8080/PaginationApplication/
    Second time–http://localhost:8080/login.do?d-1485-p=2
    and not access the data.

  • balaji 28 March, 2012, 19:03

    i got error like this when i tried to run this code HTTP Status 404 –

    ——————————————————————————–

    type Status report

    message

    description The requested resource () is not available.

    ——————————————————————————–

    Apache Tomcat/7.0.26

    please tell me what to do

    • balaji 28 March, 2012, 19:04

      viral plz help me

  • Dimple 25 May, 2012, 18:17

    i wanted the code for display tags with ajax in struts2.. plz can u hlp me out?

  • Aditya 19 June, 2012, 19:33

    Header is not coming while downloading the data, how can it possible.

  • prabhu 6 August, 2012, 16:44

    is showing error
    Can not find the tag library descriptor for “http://displaytag.sf.net”
    help me

  • Varun 9 August, 2012, 9:35

    Can you tell me what needs to be done for duplicate submission in display tag?

  • saharsh 16 October, 2012, 16:41

    If I want to have in ROW WISE format will it be possible with the display tag?…

  • jhon 30 October, 2012, 14:43

    while running the page it shows 404 exception what i have to do.any body help mee

  • Kiran 7 November, 2012, 13:38

    Hey i am trying to do the same in the spring mvc but not able to export the table in the pdf or excel . Could you pleas upload the display tag example with spring mvc 3 . Thanks!!!

  • tejas 18 December, 2012, 10:08

    I am getting below exception:
    java.lang.ClassNotFoundException: org.displaytag.tags.TableTagExtraInfo

    I have checked this class in displaytag.jar its present and also changed jar But still getting same exception.
    Any help would be appreciated..

  • Ramsushil Patel 8 January, 2013, 14:37

    Hi sir

    I am Ramsuhsil Patel work at post of AOSE.
    really pagination trips is very easy.

  • Aravindh 23 January, 2013, 19:33

    i am trying to fix the title while scrolling still i didn’t get the result if you have solution please replay me its urgent.because i don’t want the pagination.

    Thanks,

    Aravindh

  • Senthil Kumar 25 January, 2013, 11:33

    To Give the coluimn width use the display table css property or u need to give it for single table just use style attribute in displayu:column tag

  • abdul rahim khan 1 March, 2013, 17:32

    Mar 1, 2013 5:31:07 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Program Files\Documentum\Shared;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Java\jdk1.6.0_18\bin;C:\ANT_HOME\bin;C:\Program Files\Java\jdk1.6.0_18\bin;D:\eclipse;
    Mar 1, 2013 5:31:08 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:MyPaginStrutsDemo’ did not find a matching property.
    Mar 1, 2013 5:31:08 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Mar 1, 2013 5:31:08 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 859 ms
    Mar 1, 2013 5:31:08 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Mar 1, 2013 5:31:08 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
    Mar 1, 2013 5:31:08 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(D:\My Eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\MyPaginStrutsDemo\WEB-INF\lib\servlet-api.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Mar 1, 2013 5:31:09 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Mar 1, 2013 5:31:09 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Mar 1, 2013 5:31:09 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/93 config=null
    Mar 1, 2013 5:31:09 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 1095 ms
    Mar 1, 2013 5:31:11 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.ClassNotFoundException: org.apache.commons.lang.UnhandledException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at java.beans.Introspector.instantiate(Unknown Source)
    at java.beans.Introspector.findExplicitBeanInfo(Unknown Source)
    at java.beans.Introspector.(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at org.apache.jasper.compiler.Generator$TagHandlerInfo.(Generator.java:3911)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2174)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1632)
    at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
    at org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    at org.apache.jasper.compiler.Generator.generate(Generator.java:3461)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:709)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:680)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:56)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
    Mar 1, 2013 5:31:11 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet action threw exception
    java.lang.ClassNotFoundException: org.apache.commons.lang.UnhandledException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at java.beans.Introspector.instantiate(Unknown Source)
    at java.beans.Introspector.findExplicitBeanInfo(Unknown Source)
    at java.beans.Introspector.(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at org.apache.jasper.compiler.Generator$TagHandlerInfo.(Generator.java:3911)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2174)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1632)
    at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
    at org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    at org.apache.jasper.compiler.Generator.generate(Generator.java:3461)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:709)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:680)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:56)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
    Mar 1, 2013 5:31:11 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.ClassNotFoundException: org.apache.commons.lang.UnhandledException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at java.beans.Introspector.instantiate(Unknown Source)
    at java.beans.Introspector.findExplicitBeanInfo(Unknown Source)
    at java.beans.Introspector.(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at org.apache.jasper.compiler.Generator$TagHandlerInfo.(Generator.java:3911)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2174)
    at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1632)
    at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
    at org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    at org.apache.jasper.compiler.Generator.generate(Generator.java:3461)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:709)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:680)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:56)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)

    Please check the file and mail me where is the wrong thing i am doing….please its urgent

  • krishna 21 March, 2013, 11:24

    Error(5): “http://displaytag.sf.net” is not a registered TLD namespace what ican do

  • suresh 9 April, 2013, 12:57

    Please provide me sample code for delete and update links for each record in the pagination

  • Rajendra 24 May, 2013, 21:27

    Hello Viral,

    We have struts 1.2 application and we are tring to create an editable gird to get and save values back to database. Display is coming fine but values are not going back to action form on save.
    Could you please help.

    Thanks,
    Rajendra.

  • Anu 27 May, 2013, 15:00

    Hi Patel,
    Your blog is cool.. !!
    I have one question regding the usage of display tag lib for pagination.The search data gets appended while we navigate form page 1 to page-N to the URL.How to avoid this?

  • Rakesh 4 June, 2013, 11:14

    Hi,
    I want to use two display tag libraries for two tables at a time in a single jsp.
    Am using struts1. But, i face a problem on two export options.
    Can u please find a solution and Forward to me.

Leave a Reply

Your email address will not be published. Required fields are marked *

Note

To post source code in comment, use [code language] [/code] tag, for example:

  • [code java] Java source code here [/code]
  • [code html] HTML here [/code]