Results 1 to 7 of 7
  1. #1
    springredfire is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default C : import problem importing HTML file

    Hello
    I am new in the forum.
    I have a problem, I am trying to import a html file from a folder (reporte). In the folder there are pictures , and the index.html.

    In the index.tml there is a <img src = picture.jpeg />. Unfortunately, I cant modify the index.html and make the img src path to be absolute.


    reportedireccion : /reporte/index.html

    When I use
    Java Code:
    <c:import
            url="${reportedireccion}" />
    The index is load, but the image is not shown. The path requested is ( project/picture.jpeg) and I need ( project/reporte/picture.jpeg).

    If I use an iframe all works perfectly, but I was asked specifically not to use iframes

    Java Code:
    <iframe src="${reportedireccion}"></iframe>
    I also tried with ,

    Java Code:
    <c:import var="data" url="${reportedireccion}"/>
    <c:out value="${data}"/>
    but it only prints the index.html as a String.


    Does anyone know how to solve my issue ?

    Thanks in advance

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,846
    Rep Power
    19

    Default

    But if the picture is in your_project/reporte/your_picture.jpg then why do you expect the client to request it from your_project/your_picture.jpg?
    Can you show us an example of the html for the img tag?

  3. #3
    springredfire is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    the img is called in this way

    XML Code:
        <td colspan="8" valign="top" class="style-7"><img src="picture1.jpeg" class="style-8" /></td>

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,846
    Rep Power
    19

    Default

    So there you go.
    That tag there is telling the client to request the image from the top level of the website...not in a subdirectory.

    So, you can either change that tag, or move the image.

  5. #5
    springredfire is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    The problem is that I can't do any of them
    The html and the image are generated automatically and I cant change them.
    Furthermore there are a lot of folders /reporte/index.html , /reporte1/index.html, /reporte2/index.html with pictures, so it is imposible to me to put all the images in another folder together.

    Thanks!

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,846
    Rep Power
    19

    Default

    Then you're stuffed.
    You are essentially asking for the moon on a stick...or for HTTP to work differently just for your app.

  7. #7
    springredfire is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Replies: 0
    Last Post: 04-02-2011, 10:22 AM
  2. Replies: 6
    Last Post: 02-10-2011, 09:55 AM
  3. Problem in importing jar file in libraries of netbeans
    By dataprofiling in forum AWT / Swing
    Replies: 1
    Last Post: 03-30-2010, 11:30 AM
  4. Problem in reading HTML input field while uploading file
    By sudipanand in forum Java Servlet
    Replies: 1
    Last Post: 11-27-2008, 09:26 AM
  5. How can I include a html file in html textarea?
    By surya_dks in forum New To Java
    Replies: 2
    Last Post: 10-04-2008, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •