Linking to the FileDownload Servlet

The FileDownload servlet is used to download an image resource from the Cúram database. The path to the file download servlet is servlet/FileDownload which is relative to the application's context root. The ../ path prefix is also needed to move from the locale-specific folder as shown in this excerpt from the sample code:

Figure 1. Linking to the FileDownload Servlet
photo.setAttribute("src",
      "../servlet/FileDownload?"
      + "pageID=Sample_photo"
      + "&id=" + personID);

The FileDownload servlet has to be configured to use the parameters shown in the URI above to download the correct photograph. This is described in detail in later in this chapter.