Chapter 9. Images, CSS, and scripts: working with resources
In this chapter:
- Including images, scripts, and stylesheets using packaged resources
- Providing downloadable content with dynamic resources
- Integrating third-party libraries using resources
Up to now, we’ve mainly been talking about components. As powerful as they are, there are some things you can’t do with them. For example, you can’t render PDFs with them, and they don’t provide a direct answer to how images or CSS files should be handled.
In the first part of this chapter, we’ll look at what we call packaged resources and show how they can be used to develop custom components that ship with their own images and other dependencies. After that, we’ll investigate three ways to use Wicket resources to build functionality for downloading cheese discounts in a file of comma-separated values (CSV). The final part of this chapter examines how you can use Wicket resources to integrate third-party software that generates PDFs, images, and so on.
First, let’s look at a concept you’ll likely be using soon: packaged resources.