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.

134 Comments

Application is very helpful and the way what you people explained really good.
At a single shot we can develop the application like making coffee.
Thanks dudes… keep maintain these type of application .
Sateesh

I have a related question: I keep seeing these HTML/CODE/PHP snippets that are shown in a similar way, with line numbers, odd and even line highlighting etc. My question is: what editor works that way? i’d like to use it also and produce screenshots like that.

Hi Yosefus,
For adding style sheet like odd even colors to the displaytable, you have to add following CSS classes in the CSS file that you include in JSP.

odd– assigned to the tr tag of all odd numbered data rowseven– assigned to the tr tag of all even numbered data rowssorted– assigned to the th tag of the sorted columnorder1– assigned to the th tag of the sorted column if sort order is ascendingorder2– assigned to the th tag of the sorted column if sort order is descendingsortable– assigned to the th tag of a sortable column

Hi,
I want to add edit/delete link in display:table tag.When i click on the link for particular row (e.g. data for row having name field as ‘smits’ should be displayed on the form) the data should be displayed in text so that i can edit it.
Can you plese give me some sample code for edit and delete row from display:table also from database.

@ashish: You can configure the pagination links by changing the property in displaytag.properties file. For overriding the default properties, you need to create a file called displaytag.properties and place it in classpath. And change the property paging.banner.full which by default is:

hii viral
i have included the jar files mentioned but still i am getting this error after deploying it on netbeans
it says:
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException

Hi,
Nice job, but in this tutorial u r get an predefined items in the ArrayList object and then u store it session scope(if I’m not wrong)………that’s mean when we fetch some huge data from database dynamically then the session will be heavy…………….can u demonstrate it into request scope with every time when user click the next button every time an sql query fire (with just change the value of ‘LIMIT ‘ dynamically) and give me the next page

Hi Viral, I am using struts2 to develop portlets to deploy in IBM portal server 6.1 using RAD 7.5. I am using display tags to present list datatypes in JSP. But i can able to display table when the data is in request scope. I want to get values from session and display in table. DT is not reading session scope objects. Can you please help me out in finding the solution?

Does pagination only extract records (for exmaple, from a database) during navigation time when the user is clicking on the forward / backward / first / last buttons or does displaytag need to load the entire list of data (in memory) once the UI page is rendered?

If I have a search screen and the user mistakingly created a search filter that returns thousands of records, I’d hate to load that amount of data in memory. What I would like to do is display only a small subset of data returned from the search result and extracts the next subset depending on the user navigation/pagination. Is this how displaytag works?

Hi,
This stuff is really helpful for display tag usage.
But I have some different scenario for the display tag which is as below.
I am using an AJAX to call the internal .jsp pages inside one template .jsp page,
And I am using display tag inside the inner page for displaying list and using export functionality of display tag.
But my problem with display tag is I am not able to use sort functionality due to AJAX.

Can anybody tell me how I should call JavaScript function from display tag for sorting functionality?

I had to change the Contacts class so it was Comparable (required for sorting)

public class Contact implements Serializable, Comparable { …

Then instead of name=”sessionScope.UserForm.forbesList” I used the list of contacts I pulled from a database using hibernate listContacts. This is made available from the ContactAction which is specified in my struts.xml file when I call this .jsp file. Then I list an action in the requestURI=”” I just used index since that was my action that called this page.

Firstly i thank u for the work u’ve done and its very useful for the learners and beginners like me. I just need one clarification from u. are the jar files which u’ve mentioned are suffficient to run this program or anything else to be added. I’m using struts frame work, and i couldn’t get the data it’s showing that nothing found to be displayed. Can u tell y exactly this problem is coming

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?

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!

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.

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.

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.?

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?

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.

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

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.

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.

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

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.

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?

Hi ,
I’m trying to sort the data in the display table based on the column name.But the column name retrieved from the below code
ParamEncoder pe = new ParamEncoder(view.getViewId());
String sortColumnParam = pe.encodeParameterName(TableTagParameters.PARAMETER_SORT);
String sortColumn = request.getParameter(sortColumnParam);
That is the value of the sort column is Null. Please let me know hoe to resolve this issue

Hi Viral,
I am using display table in spring mvc application. In controller I set the List in sessionscope.
In jsp i m using like <display:table id="item" name="sessionScope.catList" cellspacing="10" cellpadding="10"
Problem is when click next or last it is showing 'Nothing found to display"
But data is there. can you please help me.

Hi Viral,
We are using Spring MVC with display tag to show lists in tabular form, my pagination works perfect, but for sorting we are using external sort property in display tag, and when we click on any column header in table, it’s always redirecting to page 1 after sort; when we are in page 1 that’s not the issue, but when we navigate to page 4 for example, its is redirecting to page1 after sort, I gone through the request and when we sort, the page number is not present in the request; could you please suggest me some solution to the above problem;

Viral if my Object size is too large say 5000 book objects than java throws outofmemory exception
Because display tag library loads all object first time(Eager loading) and then apply Pagination….if you have solution pls tell me Thnx in advance…

Hello Viral Sir,
We need the source code of StrutsDisplayTag.
It is very necessary to us.
Because we have so many errors.
That’s why we need code sir.
So please as early as possible upload the full code of the project.

Friend, do you indicate in the tutorial, but when I run it shows “HTTP Status 503 – Servlet action is not available at this time” and I made sure if running other examples and work normally. There’s something extra we need to do?

I want to display 100 , 100 items at a time after each hunder the next button should get enabled or disabled based on the presence of next record.
e.g : i have 130 records on first instance i want to fetch 100 records and display so the next button should get enable as next 30 record is there. on click of next record from 101 to 130 will
get fetch and display with disabled next button.

Hi Viral,
I am a newbie.In my index.jsp page I am using Record adding and record display through display table.When index.jsp page is getting loaded display table giving message nothing found to display.After I add a record the display table is displayed with all the records.
I want display table to get displayed on index.jsp page load.Please help.using struts2.
Thanks
Raichand Ray