Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Display remote image as though it is a local image

  • 09-11-2007 5:02pm
    #1
    Registered Users, Registered Users 2 Posts: 378 ✭✭


    Ok not sure if that subject is clear...

    But I need to have a method of displaying images on my site as though they came from my site. I am using jsp's and have come up with this so far...

    getaremoteurl.jsp
    <&#37;@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ page contentType="image/jpeg" %>
    <c:import url="<%=request.getParameter("loc")%>" />
    

    a test for this I imagine is...
    <img src="/getaremoteurl.jsp?loc=http://www.nodomain.com/image.jpg">
    

    It just displays the ansi interpretation of the image file... any ideas? Or another method for doing this?


Comments

  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    Write a servlet to handle a request and response. The response type would be the image/jpeg.

    Also, <c:import url="${param.loc}"> would work.


  • Registered Users, Registered Users 2 Posts: 378 ✭✭sicruise


    Cheers...

    I was just kind of hoping there was an easier way... so basically I should get the bytes from the file and write to the output stream?


Advertisement