1) Write a servlet that returns the icon. Your html page would then reference the servlet, providing enough information in the url so that the servlet can identify the icon.
2) Use an external directory (http://wiki.jboss.org/wiki/Wiki.jsp?page=ExternalDirectories) and place the icons there. Unfortunately, this means having two three things to deploy instead of just two.
I would go with option 1.