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.

Simple "workaround" for exporting with the displaytag using Tiles

I figured out an easy "workaround" to the fact that the displaytag's export feature (to XML, CSV, and Excel) doesn't work when using Tiles. The happens because the response has already been committed by Tiles (when including previous JSPs) and the displaytag is unable to set the contentType. Here's my workaround:

In struts-config.xml, create a local forward that goes directly to the JSP:

  <forward name="exportList" path="/WEB-INF/pages/userList.jsp"/>

Then in your Action, add a little logic to see if you should forward to the definition or to the list:

  // if exportType is a parameter, forward directly to JSP
  if (request.getParameter("exportType") != null) {
    if (log.isDebugEnabled()) {
      log.debug("export detected, forwarding directly to list jsp");
    }

    return mapping.findForward("exportList");
  } else {
    // return a forward to the user list definition
    return mapping.findForward("list");
  }

Tested with displaytag 0.8.5 on Windows XP and Tomcat 4.1.27. Enjoy!

Update: This workaround will not work with displaytag 1.0b1. There is another solution using a Filter, so we'll try to incorporate that into the 1.0 release.

Posted in Java at Oct 02 2003, 09:58:41 PM MDT 1 Comment
Comments:

Have you been able to get DisplayTag working with JSTL? DT is a beautiful tag, but I'm not sure how to use it to take data from an SQL query and display with DT. I've heard some rumors about having to build a list, but I'm not sure.

Posted by Nic Werner on November 21, 2003 at 01:32 PM MST #

Post a Comment:
  • HTML Syntax: Allowed