2 Replies Latest reply on Feb 21, 2003 7:12 PM by Robert Hedin

    Dynamic images on JBOSS 3.0.4/Jetty

    Olga Agady Newbie


      I am trying to figure out how I can save dynamic images in a directory which is outside of my EAR file and access those images from HTML client.

      I deploy EAR file on JBOSS_3.0.4/Jetty. My application needs to dynamically get images from the database and save them on the file system, so the HTML client can display those images, for example:

      <IMG src="../MembersImages/Member123.jpg/>
      <IMG src="http://www.myhost.com/MembersImages/Member123.jpg/>

      My question is: in which JBOSS's directory I have to create the directory "MembersImages" (since it is not in the EAR file)?

      Thank you for help in advance

        • 1. Re: Dynamic images on JBOSS 3.0.4/Jetty
          Robert Hedin Newbie

          We do the following:

          We've got graphics stored as a blob in an oracle database.
          We create a servlet that can, given a mapping of some kind, look up the graphic in the db and returns it to the client.

          Our anchors are then setup like:

          Our web app is deployed to the /webapp context above, and the servlet is mapped to /GetImage/*

          The servlet gets the request, looks up the image in the db( from above, "imagename.gif"), sets the ContentType to "image/gif" (or whatever) and the content length, and returns the data stream to the client. No need to write anything to the filesystem at all.

          Actually, we end up using an LRU caching system, to avoid hits to the DB (since our images really don't change once created).