Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

NYC: DisplayTag and Struts Menu

At the NYC Conference, I'm going to be talking about The Display Tag and Struts Menu. I figure the best presentations are ones that cover new features or introduce something new. So I'm hoping to add the following features to the two libraries in the next month. Please let me know if there are other's you'd really like to see - or ones that'd make the audience go *wow*.

DisplayTag: I'd like to add this pagination enhancement so you can get easy interaction between the records displayed and the records fetched. I'd also like to see sorting by property, not be contents. Lastly, I hope to add an example that does CRUD on a table using JSTL and simple checkbox and input fields.

Struts Menu: A lot of users are interested in seeing a menu that's created from a database table. This shouldn't be too difficult because examples are out there. I was also thinking of adding support for the Joust Outliner, but it doesn't look like it's still developer or actively used. If there's interest, I'll add it.

If you think I'm blogging a lot today (don't you work Raible?), it's because I'm on babysitting duty. Abbie is sick with a fever and Julie had to go to work - so my work day starts when she gets home. I've got the little one tied up with a little Winnie the Pooh action right now...

Later: The DHTML Kitchen has some nice menus, but they're not free. Anyone know of open source menus like these?

Posted in Java at Feb 24 2004, 02:41:26 PM MST 33 Comments
Comments:

I want at least a I love NY sovenir :-)

Posted by Ed Hill on February 24, 2004 at 09:54 PM MST #

I wish displaytag doesn't hit the database for every paging or sort request.

Posted by Unknown on February 24, 2004 at 09:54 PM MST #

Anonymous - it doesn't have to. You can stuff your collection in the session and do it that way. Any other solutions/ideas are most welcome.

Posted by Matt Raible on February 24, 2004 at 10:08 PM MST #

Matt, It'd be nice if DisplayTag had an API/interface for querying for Collections that I could use to bridge to my various APIs. For example, I have a method getSpokeBookEntries(Map params), but I can't expect DisplayTag to know/care about it. However, I might want to specify a bridge that I could write that implements a standard DisplayTagQuery interface that handles ordering, windowing, columns to select, etc.

Posted by Patrick Lightbody on February 24, 2004 at 10:19 PM MST #

Ed - you definitely deserve <em>something</em> since you're wrote this bad boy. Let me know what interests you and I'll see what I can do.

Patrick - if I understand you correctly, you don't want to use your proposed API for <em>displaying</em> results, but rather to do the sorting/paging processing?

Posted by Matt Raible on February 24, 2004 at 10:30 PM MST #

Matt, I have been doing what you suggested, i.e. stuff the collection in the session. But I'm wondering how do you clean the collection from the session afterwards?

The application I'm working on at the moment needs to retrieve lots of collections with thousands of records. And when the application has hundreds of sessions at the same time, the memory usage becomes pretty high.

We were thinking of adding the capability to pass the collections from request to request as necessary , but due to time limitation, we ended up adding paging capability to avoid thousands of records within a collection.

Anyway, I was going to post this to the mailing list, however, since no one responded to my last question (http://sourceforge.net/mailarchive/forum.php?thread_id=3791040&forum_id=28703), I thought mentioning the question here might be relevant since you mention about stuffing collection into session.

Posted by Harod Ruthgar on February 24, 2004 at 11:05 PM MST #

!recently I just start a small project based appfuse, and when render the list form using displaytag, I can't found a tag to do the job like folowing struts form tag: {{{ <td> <html:select property="qyxz" styleId="qyxz"> <html:options collection="rs_qyxz" property="value" labelProperty="label"/> </html:select> </td> }}} May be I am wrong? I just want the ID to display as a label? sorry for my poor English.

Posted by stone0660 on February 25, 2004 at 08:24 AM MST #

Matt and ED Have you thought about using POI to return actual excel spreadsheets rather than CSV files for DisplayTag? I would be willing to help a bit on that. POI is a great API (simple to use and well documented) Thanks, Steve

Posted by Steven Citron-Pousty on February 25, 2004 at 11:43 AM MST #

If you are speaking in NYC about DisplayTag, why are you not speaking in VA about AppFuse? http://www.nofluffjuststuff.com/2004-05-reston/index.jsp

Posted by Carl Fyffe on February 25, 2004 at 03:42 PM MST #

Steven - have you looked at the Excel Export option in the DisplayTag? It exports directly to Excel and doesn't require any third-party libraries. I just don't see the need for POI.

Carl - I'm not speaking at any No Fluff Just Stuff events - rather Rick Hightower is. Why? Because he was invited and I wasn't. ;-)

I do plan on helping Rick with his presentation, and hopefully it'll become a part of the standard AppFuse documentation.

Posted by Matt Raible on February 25, 2004 at 03:52 PM MST #

Matt - yes. For high volume sites, we can't afford to query entire lists every time. Rather, we only construct objects (and marshall them over the distributed wire) that we are going to display. Just basic windowing stuff. I think this would be a _huge_ win to have implemented in a generic table tag.

Posted by Patrick Lightbody on February 25, 2004 at 04:08 PM MST #

Thats a bummer. I was really looking forward to meeting you.

Posted by Carl Fyffe on February 25, 2004 at 04:08 PM MST #

Matt: I perused the CVS over the web and it looks like you are giving a CSV with a mime type of excel so the browser fires up the response in excel. POI would actually produce an excel spreadsheet (binary file, not text). I don't know if you think its needed. Steve

Posted by Steven Citron-Pousty on February 26, 2004 at 02:37 AM MST #

Perhaps the main benifit of poi produced Excel would be if you could get the excel spreadh sheet to actually look like the on screen display! In any case a poi dependency might bloat the library for the 99.9% of people who don't want it - a plugable export model might be a better idea (alal ColumnDecorators)

Posted by Sam Newman on February 26, 2004 at 11:40 AM MST #

Display tag is a real time saver for pagination of long lists. For columns with numbers, how do I display the sub-total of the current page, display the forwarded totals from the previous pages, and also display the grand total to date, at the bottom of the page? Thanks

Posted by Roshan Shrestha on February 23, 2005 at 08:24 PM MST #

"pagination enhancement" I feel great to see that. Many thanks.

Posted by Alex Qiu on March 15, 2005 at 08:27 AM MST #

Matt: i am working on some sort of timetable that displays a timeline iterates over a collection, displays a name and for each name it displays a line (coloured cells) in the table. Do you think it is possible to "color" separate cells using the displaytag and could you tell me how? If not is anyone aware of a library that does provide this functionality?

Posted by Joshua on May 03, 2005 at 10:07 AM MDT #

Does DisplayTag support input types (like a checkbox?) I'm creating a CRUD app also, and want to be able to put a checkbox next to every row so that the user can select it to edit/delete. Have you done this within the <display:table> tag?

Posted by Deen on May 13, 2005 at 04:08 PM MDT #

Sorry, I've found that by putting the input type in the display:column tag it displays. I had been trying just to put it inside the display:table tag.

Posted by Deen on May 16, 2005 at 05:11 PM MDT #

Hi, I am using check boxes in display tag my page Size is 10. if i have 100 records are seperated into 10 pages In first page i am unchecking some records and moving to next 10 records by clicking next link. I am unchecking some of them also. Again i am coming back by clicking prev. Here the unchecked boxes are also again checked one. Here is my coding <bean:define id = "titleSelect" name="billForm" property="titleSelect" type="java.lang.String" /> <bean:define id = "titleNo" name="billForm" property="titleNo" type="java.lang.String" /> <bean:define id = "titleType" name="billForm" property="titleType" type="java.lang.String" /> <bean:define id = "titleShortName" name="billForm" property="titleShortName" type="java.lang.String" /> <bean:define id = "titleDate" name="billForm" property="titleDate" type="java.lang.String" /> <bean:define id = "titleCompleteDate" name="billForm" property="titleCompleteDate" type="java.lang.String" /> <bean:define id = "titleStatus" name="billForm" property="titleStatus" type="java.lang.String" /> <% int c=0; %> <display:table id="autoBill" name="REQUEST_List" border="0" paeSize="10" requestURI="toSelectionScr.do"> <display:column width="5" title="<%=titleSelect%>" > <input type="checkbox" name="select<%=c%>" checked/> </display:column> <% c++; %> <display:column property="no" title="<%=titleNo%>"/> <display:column property="typeShortName" title="<%=titleType%>"/> <display:column property="shortName" title="<%=titleShortName%>"/> <display:column property="date" title="<%=titleDate%>"/> <display:column property="completeDate" title="<%=titleCompleteDate%>"/> <display:column property="dtatus" title="<%=titleStatus%>"/> </display:table> </td> </tr> How can i resolve this problem? Pls help me ---- Suresh

Posted by Suresh on February 22, 2006 at 05:54 AM MST #

Hi is it possible to put a button on the header part?

Posted by virgie on March 30, 2006 at 12:04 AM MST #

mhmopùo

Posted by 196.203.50.3 on April 19, 2006 at 02:13 PM MDT #

kkkk

Posted by eee on April 30, 2006 at 11:30 PM MDT #

Hi , I want to sort a coulmn having data which is basically date in the format mm/dd/yyyy Can I sort it using display:tag

Posted by Gaurav on June 13, 2006 at 12:46 PM MDT #

I am trying to use the following code inside a display tag... <display:column title="Tick to validate or dispute"> <c:if test='${row.strBillingStatus eq "Ready for Customer Validation"}'> <html:checkbox name="chargeForm" property="intDisputeOrValidateCheck" value="${row.intUnbilledChargeId}" tabindex="9" /> <c:if test='${row.strCircuitId != null}'> </c:if> </c:if> <c:if test='${row.strBillingStatus ne "Ready for Customer Validation"}'> <c:out value="${row.strBillingStatus}" /> </c:if> </display:column> here rest all is working fine but in the line value="${row.intUnbilledChargeId}" tabindex="9" /> this value is not getting evaluated....If i give a normal Integer it works but this expression is not getting evaluated correctly...though the same thing gives the correct output in the c:out below that.

Posted by Sandeep Wagh on November 03, 2006 at 10:22 AM MST #

Hi!

We are using displaytag, and displaying dynamic columns, but some how "title" is not binding the bean values. Anyone knows how to display dynamically title from bean.

<display:column property="${column.name}" title="${column.title}"  sortable="true" />

Any help would be appreciated.


Thanks,
Anil

Posted by Anil G on November 06, 2006 at 05:10 PM MST #

Paging with Displaytag Struts and Tile

<filter>
    <filter-name>ResponseOverrideFilter</filter-name>
    <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
</filter>
---------------------------------------

<filter-mapping> <filter-name>ResponseOverrideFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>ResponseOverrideFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> ----------------------------------
=============================================
JSP: Display2Tile.jsp

...
<jsp:useBean id="today" class="java.util.Date"/>


<jsp:useBean id="service" class="ch.adnovum.ejblueprint.web.beans.CarService" />


<ajax:displayTag id="displayTagFrame" ajaxFlag="displayAjax">

Last Time Table Refreshed: <c:out value="${today}"/>

  <display:table name="service.allCars" class="displaytag"  pagesize="10" scope="page"
    defaultsort="1" defaultorder="descending" export="true" id="row" excludedParams="ajax"  requestURI="Display2Action.do">

***....
..... ....

----------------------
for new tile (Display2Action go to new Tile and ..)
<definition name="displaytag2" path="/WEB-INF/jsp/Display2Layout.jsp">
    <put name="errors" value="ErrorsTile.jsp"/> 
</definition>


<definition name="Display2Tile.def" extends="displaytag2">
    <put name="body" value="Display2Tile.jsp"/>
</definition>

Posted by Limun on November 20, 2006 at 10:23 AM MST #

Hi, I'm quite new to this displaytag thing. So I face this problem where I need to display a list, then user can click on the link of a particular record in the list, then the detail of the record will display below (in the same page). However the requirement is I need to retrieve the list and the record detail from database. My problem is if the record detail will be listed but the page will show the first page even though the record is listed in the second page of the list. I have try something like setCurrentPage using SmartListHelper class but still it didn't work. Thanks in advance.

Posted by kyoune on May 15, 2007 at 06:05 AM MDT #

Can it be possible to display the export link of display tag at the top of the table? I want to display the export link at the top of the table.

Posted by Romita on March 17, 2008 at 06:10 AM MDT #

hi i dont know where to send queries so i am sending to u. plz help me i am stuck into the display tag as iam displaying page when i click on to the next page it is displaying some null pointer exception and jsp parse error

Posted by jyoti on May 08, 2008 at 11:06 AM MDT #

hi i dont know where to send queries so i am sending to u. plz help me i am stuck into the display tag as iam displaying page when i click on to the next page it is displaying some null pointer exception and jsp parse error

Posted by jyoti on May 08, 2008 at 11:07 AM MDT #

Hi, I am using <display:table> tag for displaying a table. I am getting table displayed with paging and sorting but I want to use edit and delete row functionality with <display:column>. I used code as follow: display.jsp................................ <display:table export="true" id="data" name="userList" requestURI="/Display.do" pagesize="5"> <display:column property="name" title="Name" sortable="true" autolink="true"/> <display:column property="payment" title="Payment" sortable="true" /> <display:column property="date" title="Date" sortable="true"/> <display:column title="Action"> <html:link action="/Edit" paramId="name" paramName="DispalyForm" paramProperty="name">Edit </html:link> </display:column> </display:table> and struts-config.xml contains:.................... <action path="/Edit" type="com.myapp.struts.EditAction" name="DispalyForm" scope="session" input="/edit.jsp"> <forward name="success" path="/Display.do"/> </action> but when i click on Edit link nothing is displayed. Plese tell me what should i chande to get the output. Thanks, Smita

Posted by smita on October 26, 2009 at 09:38 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed