> ...how we can get a image with a dynamic source via servlet?!?
> Thanks
> nicole

Think about returning a HTTP redirect from the servlet to the static file.

eg
http://www.w3.org/Protocols/Specs.html ->
http://www.w3.org/Protocols/rfc2068/rfc2068

(from RFC 2068: HTTP 1.1)
10.3.4 303 See Other

   The response to the request can be found under a different URI and
   SHOULD be retrieved using a GET method on that resource. This method
   exists primarily to allow the output of a POST-activated script to
   redirect the user agent to a selected resource. The new URI is not a
   substitute reference for the originally requested resource. The 303
   response is not cachable, but the response to the second (redirected)
   request MAY be cachable.

   If the new URI is a location, its URL SHOULD be given by the Location
   field in the response. Unless the request method was HEAD, the entity
   of the response SHOULD contain a short hypertext note with a
   hyperlink to the new URI(s).

and also 

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServ
letResponse.html#sendRedirect(java.lang.String)

thus

public abstract class ImageRedirector
    extends HttpServlet
    {
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException
        {
        String relativeOrAbsoluteUrl_1 = "../images/whatever.123.gif";
        String relativeOrAbsoluteUrl_2 =
"http://us.a1.yimg.com/us.yimg.com/i/ww/m5v5.gif";;
        resp.sendRedirect(relativeOrAbsoluteUrl_1);
        }
    }

john

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to