Hi,
I'm currently playing a bit around with JBoss and testing some things. I have two source projects: One web project ("frontend") containing a couple of JSPs, project specific design and stuff like that. The other source project ("backend") implements some classes, which are used by the JSPs via a taglib. One of those classes is generating some JavaScript code. The backend is included into the frontend project as a JAR file.
This JavaScript code loads some icons and displays them. The problem I have is, where to put the icons so that they can be downloaded by the JavaScript. If I add them to the frontend project, they can for sure be obtained by the browser via URL. But they belong to the backend, as they are part of this application.
In the future, both projects might be developed by different people. And I don't want the frontend guys to bother with all resources needed for the backend. This should all be included in the JAR file.
Does anybody have a hint for me, how to achieve this?
Thanks, Heiner
Two possibilities.
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.