Images outside the war file not being displayed URGENT !!!!!

Discussions

Web tier: servlets, JSP, Web frameworks: Images outside the war file not being displayed URGENT !!!!!

  1. I have created a war file. I have some images inside the war and some outside the war file as images are changed on a regular basis.

    The images inside the war are being displayed however the images outside the war file are not being displayed.


    How can the image file outside the war be displayed when a JSP is requested???



  2. Most servlet engines will run both a packaged war file and also the extracted version. If you are rapidly changing things during developement and can't be bothered with the hassle of rebuilding and redeploying the war then just run from the extracted version.

    Stu
  3. I need to specifically deploy the application as a war file and deployment in exploded format is not an option right now.

    As the images are changed frequently they are kept out of the war file as it is deployed using a build process.

    Thanks in advance.
  4. See Content tag from Coldtags suite
    www.servletsuite.com/jsp.htm

    you may include files that are out of your web application
    tree.
  5. Mabe you already done this, but the path of the image outside the war file could be different. So, have you verify that the image is located is the right directory?

    You might want to right click on the image that doesn't work and is if the path is where you expect to see.

  6. Hi Jacob,

    I have the similar requirement to yours. Did you solve the problem?

    I have one ear which is deployed into WLS 6.1. In my ear, I would upload files from client into a folder on the server; I would use the same folder to download files from server to client. I have to jar the application for deployment.
    I use web.xml to specify the directory for file upload/download. If it is a absolute directory, it's ok for upload. But an applet of the applicatin cannot get file from this directory because the folder is external to the jarred application. If it is in other directory form, then WLS 6.1 throws an exception stating the specified directory is not directory.

    How should I specify the directory so that the servlet/JSP in the application can recognize the directory to upload/download files as well as the applet can display the them (normally the files are images)?

    Thanks in advance.
    Lijun