Relative path with images

Hi All -
I have a strange situation with relative paths. When I use a relative path in cfinclude it works. But when I use a relative path is "src" attribute of <img>, it does not work. Can anyone suggest why could this be happening?
Thanks

Adam Cameron. wrote:
Because you're expectation is that apples work the same as oranges.
CF relative paths are relative to the CF file the path is in; HTML relative paths are relative to the URL browsed to.
Remember CF code is run on the CF server; HTML is rendered on the browser.
Adam
The beauty of relative pathing is that it plucks them from the tree and calls either fruit.

Similar Messages

  • Relative paths for images upset by forwarding requests

    Hello World.
              I am using a web app deployed in Weblogic 5.1 with service pack 8.
              I have hit a problem which puzzles me. When I forward a request from
              one JSP to another (say from A to B) the web server seems to take the
              URLs of the images on the served file (B) relative to the path on the
              calling file (A). Here's a detailed explanation...
              Suppose I have a the web app structured as follow
              /oddApp/launch/A.jsp
              /oddApp/B.jsp
              /oddApp/images/tick.gif
              Page A simply stores its request URI and forwards its request to page B
              <jsp:forward page="/B.jsp" />
              Page B displays its requestURI, contextPath and servletPath. It also
              attempts
              to show three images
              <img src="images/tick.gif">
              <img src="../images/tick.gif">
              <img src="/images/tick.gif">
              When I invoke page B directly, the first image is shown, the others are not.
              When I invoke page A, it forwards to B and the second image is shown, the
              others are not.
              In each case the URI, contextPath and servletPath are correctly displayed
              with regard to page B.
              URI = [oddApp/B.jsp]
              contextPath = [oddApp]
              servletPath = [B.jsp]
              The URI in A.jsp is also correct (i.e. /oddApp/launch/A.jsp).
              The search for the images seems to be relative to the original URI (i.e. not
              the URI used to forward), which strikes me as daft. It means that page B
              must be aware of where it is being called from. It is perfectly plausible
              that
              relative paths which suit when called from one location are incorrect when
              called from another.
              I had thought that including the leadling slash (as shown as the third
              image)
              would cause the search relative to the document root (/oddApp/), but this
              appears not to be the case. The search is done relative to the root of the
              server not the web app.
              Adding jsp mappings in the deployment descriptor of the web app does not
              help (I had thought it a long shot anyway).
              Does anyone have any thoughts on this?
              PHiL
              

    i face the same problem (WinNT, WLS6.0): my wep app has a contextRoot " root " which makes it react to the URL: http://host:port/root /: it is this folder which will be used as a basis by the Web server But in the jps I use a relative URL for images: / images/toto.gif : it works very well when I deploy my jsp out of a Web-app by setting a document.root to the weblogic web server.On the other hand, once deployed in a Web-app, images are not found because the default path of the browser is http://host:port, without the context root of the Web-app! In other words, my war has images/*.gif in its root but when /images/toto.gif is resolved in a jsp, as the relative URL is not prefixed by my context-root, the image is not search in the war! actually, if I type http://host:port/root/toto.gif, my image appearsany clues? an alias on the web server? a setting in web.xml/application.xml and their weblogic equivalent files?
              

  • Relative path to Images ?

    I recently migrated from Win XP to a new PC Win 8. Moved all the files & D.W. related apps... all went relatively seamless. But I noticed the Relative path to any Image that created in Photoshop still has the old path
    i.e.
    Original (old) file:///C|/Documents and Settings/My Documents/PMF Web Design stuff/Menu_Button_Home_2013.psd
    New file:///C|/Documents/PMF Web Design stuff/Menu_Button_Home_2013.psd
    Is there a file in my D.W. site that has these paths ???If so I could do a global update ...  I have dozens of these type entries... would hate to do all 1 by one.
    THANKS in advance

    Guess I did Not explain my dilemma correctly.  My site worked fine after I migrated to the new PC... all the SOURCE Images were in my root folder... What I could not find (up until now) was where the ORIGINAL .PSD files were referenced. D.W. keep sync information with Photoshop, if/when the Original gets updated... D.W. notifys you. Please see scrnshot GREEN arrow below.
    After several hours of P.D. I figured it out for future reference.... the ORIGINAL file is referenced in a sub-folder of your Image Folder... called _NOTES each & every image has an associated .JPG.MNO file.
    Simple example Home_Button.JPG resides in Image folder... Home_Button.JPG.MNO resides in _notes.
    Down near the bottom of Home_Button.JPG.MNO is a record that points to the ORIGINAL Parent file.
    Looks something like:    <infoitem key="FilePathSrc" value="file:///C|/Users/Documents/PMF_Design_PSD/Home_Button.psd" />
    I had hundreds of these that need updating... I used the D.W. Find & Replace feature... took a few tries to get all the options set correctly. But it saved me several hours.
    Hope this helps someone in the future migrate to/from PC's,

  • Problem defining relative path ofr images in struct tiles

    hi
    I have a jsp pages in which i am setting the layout using tiles . To display an image
    i am using < img src= "./../images/abc.gif" />
    this doesnt seem to work.
    but if i give absolute path like src="C:\myDoc|....\abc.gif" it works.
    As i have to deploy it so i cant give absolute path.
    One solution i found is to use request.getContextPath()
    <img src="<%=request.getContextPath()%>/tutorial/images/abc.gif" works.
    is there any way we can give relative path like ?
    < img src= "./../images/abc.gif" />

    Hi , I have found the solution.
    <c:url value='/javascript/menuscript.js'/>"{code} can be used to avoide the absoulte path . The c:url tag takes default  value as Webcontent . so you need to give only path after the webContent                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Relative path for images in RTF templates

    Hi everybody!
    When I insert an image in a RTF template, I put its path into the web dialog, in order to see correctly the picture when I open the report from the xmlp server, in this way: url:{"http://servername/analytics/res/Images/image.bmp"}
    How can I make this path relative, in order to see the images even if the server name changes?
    Thanks so!
    Francesco

    Hi Tim,
    I am using BIP 10.1.3.3.2. I am able to access system variable CURRENT_SERVER URL.
    Steps:
    <?param@begin:CURRENT_SERVER_URL?>
    <xsl:value-of select="$ CURRENT_SERVER_URL"/>
    CURRENT_SERVER_URL is getting printed in BI Publisher. Value displayed is http://xx4697.xxx.co.in:9704/xmlpserver.
    Now we are importing xsl into RTF template. File aaa.xsl is stored at [BIP_Installation_Directory\oc4j_bi\j2ee\home\default-web-app]
    We have hardcoded the path for XSL in RTF. The path is <?import: http://xx4697.xxx.co.in:9704/aaa.xsl?>
    As we want to set dynamic path we changed hardcoded xsl path to <?import: {$CURRENT_SERVER_URL}/../aaa.xsl?> but it is not working. Sometimes BIP is taking local path of MyDocuments folder and sometimes Desktop path. If I put that XSL file in MyDocuments folder or Desktop, it is working fine. But ideally it should refer [BIP_Installation_Directory\oc4j_bi\j2ee\home\default-web-app] path...
    Thanks,
    Amit D

  • Relative path to image in contentfolder

    Hi,
    In Configurator 1.0 I was able to put an image/logo in the content folder and use the SWF/Image Loader to show that image just by typing the images name in the URL field.
    I can't get that to work with Configurator 2.0 !?
    Do I have to type a special path to the image?
    Regards Brian

    Hi
    The image must be in your YourPanelName.assets
    Verify if your image is at this path :
    Photoshop / Plug-ins / Panels / yourPanelNameFolder / content / YourPanelName.assets
    In the "Location ( URL)" of Configurator   set the name of your image ( e.g. image.png)

  • CFINCLUDE and relative path

    I have a website which has error catching in it and from time
    to time I have this error come through when using cfinclude.
    Could not find the included template
    project56/images1/page1.html. Note: If you wish to use an absolute
    template path (e.g. TEMPLATE="/mypath/index.cfm") with CFINCLUDE
    then you must create a mapping for the path using the ColdFusion
    Administrator. Using relative paths (e.g. TEMPLATE="index.cfm" or
    TEMPLATE="../index.cfm") does not require the creation of any
    special mappings. It is therefore recommended that you use relative
    paths with CFINCLUDE whenever possible.
    Why would this error occur for a few visiters and not for all
    when browsing my website?
    If I have to put some sort of mapping into CF Administrator
    what should I put as a mapping and why should this help?
    Thanks in advance for your help.
    Simon.

    The only thing I can think of is are you sure the page the
    'affected' users are clicking from are in a parent folder of the
    'project56' folder? The error occurs when the CFINCLUDE is looking
    in the wrong folder or when you try to include URL variables in the
    include statement.
    if you INCLUDE project56/images1/page1.html it will work, but
    if you INCLUDE project56/images1/page1.html?user=123 then you get
    an error because the INCLUDE looks for the actual text of what's
    between the quotation marks...it will not pass variables.
    I'd check the folder structure on where they are clicking
    from. In your error page, just have the referring page
    output.

  • Query with relative paths

    I have a client who is fairly au fait with Dreamweaver but has run into some difficulties so they have asked me to take over.
    The problem files' (downloaded from the net into Dreamweaver using the 'get' function), relative paths were 'out' by an extra hierarchical level and hence didn't display or work correctly locally on my laptop. I haven't yet looked into why this was the case but was able to fix it without too much hassle by using the find and replace feature.
    However I am confused as to why these html pages display correctly online as their paths have an extra ../ in them.
    One of the pages that has the extra level is this http://www.wildlifeartgallery.com/exhibitions/harry_becker2/harry_becker2_page1.html
    The hierachy of the files in the website is as below with the scripts and styles folders on the same level as the index.html page. The problematic pages are located 'exhibitions/harry_becker2/harry_becker2_page1.html' to page7 (page 10 is me testing).
    Surely the relative links to the styles folder should be ../../ as they are with all the other artists' exhibition pages rather than ../../../ ??
    I would be most grateful if someone could take a look for me and give me an expIanation as to how the CSS and scripts display and work without issue when they seem to be linked incorrectly or is it me going mad!!
    Thanking you in anticipation.
    Lisa
    FYI I use Dreamweaver CS5.5 on OSx 10.6 and my clients use Dreamweaver CS6 on Mountain Lion.

    First thing I will tell you at the outset is that before you downloaded the site from the remote server, you should have defined a site on your laptop by creating the necessary folders for the site name, css, scripts, images, downloads, etc etc.  this would have put you in a better position and you would have avoided doing find & replace work.
    Now coming to your main question, the links in a website are either document relative or site relative.  The difference is that with site relative, you need to provide the full http:// address but with document relative, DW will put the links like this:
    <link href="css/main.css" rel="stylesheet" type="text/css">
    </head>
    As your site is now working, you will be better off keeping it as it is otherwise, you can read the first part of David's tutorial that teaches how to setup the basic site.  It doesn't go into creating folders for images, css, scripts etc but you get the idea after you have worked on his tutorial.
    <http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1_cs6.html>
    Good luck.

  • After forward, relative paths images are not displayed

              Hi,
              I have two web archives (war1.war, war2.war) and a jar with
              common code (jar.jar). war1.war contains jsp1.jsp and
              servlet1.class, jar.jar contains common.class, and war2.war
              contains jsp2.jsp.
              The user brings up jsp1.jsp in a browser and clicks a button
              which invokes servlet1.class (via post). In turn, servlet1.class
              invokes method forwardTo(...) of the common.class which brings
              up jsp2.jsp in user's browser. In the forwardTo(...) method I am
              using the servletContext for war1.war to get a dispatcher on
              which I then apply forward.
              The problem that I am seeing is that the images (.gif) in
              jsp2.jsp are not displayed at all. They are defined in the jsp
              file using a relative path as img="images/img.gif". It is as if
              the web server gets confused and does not know that the images
              should be based in the war2 application and is looking for them
              in the war1 application.
              I do not want to store the absolute path in the definition of
              the image (i.e., img="war2/images/img.gif").
              I am using WLS6.0sp1. What could be wrong?
              Thanks,
              Vladimir
              

    maybe try this
              instead of
              img="images/img.gif"
              try
              img="<%=request.getContextPath()%>/images/img.gif"
              "Vladimir" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > I have two web archives (war1.war, war2.war) and a jar with
              > common code (jar.jar). war1.war contains jsp1.jsp and
              > servlet1.class, jar.jar contains common.class, and war2.war
              > contains jsp2.jsp.
              >
              > The user brings up jsp1.jsp in a browser and clicks a button
              > which invokes servlet1.class (via post). In turn, servlet1.class
              > invokes method forwardTo(...) of the common.class which brings
              > up jsp2.jsp in user's browser. In the forwardTo(...) method I am
              > using the servletContext for war1.war to get a dispatcher on
              > which I then apply forward.
              >
              > The problem that I am seeing is that the images (.gif) in
              > jsp2.jsp are not displayed at all. They are defined in the jsp
              > file using a relative path as img="images/img.gif". It is as if
              > the web server gets confused and does not know that the images
              > should be based in the war2 application and is looking for them
              > in the war1 application.
              >
              > I do not want to store the absolute path in the definition of
              > the image (i.e., img="war2/images/img.gif").
              >
              > I am using WLS6.0sp1. What could be wrong?
              >
              > Thanks,
              > Vladimir
              >
              

  • How to specify relative path for background image  in xsl

    Hi,
    I am generating a PDF from Apcahe FOP. I have an xsl for that, in the xsl fo:block I am displaying a background image. When the image path is absolute like..C:\image\logo.png it works fine. But I want to have the image in my WebContent\images folder and my xsl file is in WebContent\xsls folder. So when I try giving the relative path as ../images/logo.png, the image is not displayed.
    Can anyone tell how to do this???
    Thanks,
    Sanjeev.

    I have a fo:block like this :
    <fo:block border-style="solid" border-width="0.2pt" text-align="left"
                             background-image="url('http://localhost:8080/Project/images/table_header_center.png')"
                             font-size="8pt" font-weight="bold" color="white" padding-top="1pt"
                             padding-bottom="1pt">
                             <xsl:value-of select="tr/td/span" />
                        </fo:block>In the above code you can see that the the background-image="url('http://localhost:8080/Project/images/table_header_center.png')"
    has been given as absolute. The images folder is in my WebContent directory. I want this path to be relative to the context of my application , something like background-image="url('../images/table_header_center.png')".
    Thanks.
    sanjeev.

  • Relative path for Download directory folder.I created a firefox profile and i wanted to use this profile in multiple machines.I wanted to use a relative path for download directory with respect to the profile folder.I need this on Linux machines

    I have a use case where I need to use different download directories with different firefox profiles.I need to use this profiles in multiple linux machines.
    I need to have a relative path to my download directory with respect to the profile folder.
    Ex: I have a selenium test which opens a website and downloads it to my machine.I want this downloaded file to go into some specific folder relative to this profile folder.How do I do this??

    That is not a practically empty xinitrc - that file only needs one line: exec WM.  Other things are entirely optional, and some of them very useful, but I'd encourage you to stick with the simplest xinitrc that will do what you require.
    Is slim involved?  Probably.  That is the source of many problems.  But to start narrowing this down, I have 3 suggestions:
    1) temporarily (at least) change your inittab to default to runlevel 3 ... actually, is it currently set to 5 or 3? if it is currently 3 that would explain why slim doesn't start.
    2) at a tty in runlevel 3 use "xinit" instead of "startx".  Startx is fine most of the time, but it is essentially just a complex wrapper for xinit.  That complexity can often iadd useful functionality, but it *always* makes troubleshooting more difficult.  So for now just use a vanilla 'xinit'.
    3) remove dbus-launch from your exec line in xinitrc.  This is done by console-kit so it is redundant and potentially problematic.  Further BOTH of these are taken care of by slim, so I'd even suggest getting both a jump start on being ready for slim and simplifying troubleshooting by removing both of them.  Just make that line "exec openbox-session"
    Edit: adding one more:
    4) temporarily switch out openbox-session for openbox.  I suspect the reason feh's setting of the background is getting overridden is due to a script or setting in openbox's autostart settings - many of these are only invoked when "openbox-session" is called, while "openbox" starts *just* the window manager itself.
    Last edited by Trilby (2012-10-03 17:30:36)

  • Problem with include and relative path in jsp

    Precompile jsp with wlappc in 9.2, I got the error "The include file was not found" when the jsp use <%@ include file="../includes/dataEntry/code_error.html" %>
              This code used to work with 8.1. I notice that someone has report the same problem with 9.0 and you have patch for it. Is it fix in 9.2 or do I require a patch as well?
              Thanks,
              Khuemy

    When you precompile, can you say "Keepgenerated=TRUE". It might help you track
              down the difference with the URL. You should only get a 404 error when the
              resource is not found at runtime, which is independant of when you compile. The
              difference should be in how the URL is compiled.
              Chris
              ali wrote:
              > I am using WLS 6.0 SP1, when I use relative path in <jsp:forward> in my JSPs
              > it forwards ok if I am using directly JSPs but if I am using pre-compiled
              > JSPs (and have proper servlet-mappings
              > in my web.xml), I get 404 error with the relative-path, if I change it to
              > absolute path with pre-compiled JSPs it forwards ok , then.
              > any ideas why this is so?
              > thanks,
              

  • Problem with jsessionid and relative paths

    I'm having an issue with jsessionid in a J2EE application running on an all Oracle platform (Oracle DB, 9ias, etc.). Most of the time sessions are tracked with cookies, but occasionally the jsessionid appears on the URL (on first login with a new browser window I think?).
    Anyway, sometimes the session id is very large (100 chars +) and includes special characters, specifically a backslash. This is causing problems with relative paths in the page.
    Is this normal behavior or is there a problem with my app server/JVM setup? Has anyone else seen this? Thanks for any advice.

    Hi Stefan,
              The issue was logged as CR238704. You can either contact [email protected] or
              just pass me your email Id and I'll send the patch to you.
              -- Nagesh
              <Stefan Krause> wrote in message news:[email protected]..
              > The problem I have is that the application is very old and at the same
              > time very big (so we're doing the transition step by step) and there are
              > lots of variables (and even methods in JSP pages - no comment) shared
              > between the JSP pages!
              > So for us jsp:include isn't an option...
              >
              > Is there a way to report bugs when you've got only the free development
              > license?

  • How to open a configurat​ion file with a relative path?

    I want to open a configuration file during the initialization of my application (first "state," u can say) and I am using "Open Config file.vi" and tried to pass the config file's path as "data\myconfig.ini" and the "File exists?" vi didn't give any error (simply, the output was "false") but the Open config File gave an error.
    If I pass an absolute path "D:\xyz\xyz\myconfig.ini" it works fine. Isn't it allowed to use "relative path" as I remember using it before for other tasks?
    I actually prefer to have this file in the "data" folder that my application's setup will create in the destination directory while installing the application, because it will be easy when I want to ask the user to open and edit it. Or, I would just put it in "C:\" which exists on all the windows computers, but then it would be too much open.
    Thanks ahead!
    Vaibhav
    Solved!
    Go to Solution.

    Relative paths have sometimes a meaning for command line tools (where a relative path gets appended to the current path, which usually is the executables directory).
    But for Windows GUI applications that makes not much sense. Windows also maintains a per process current path, but that path gets updated by several Windows APIs, one of them being the File Dialog. So whatever your user has last selected in any file dialog inside your application will from then on be the applciations current path. It should be clear that with such a braindamaged current path implementation it has basically no useful meaning, and LabVIEW consequently does not do path expansion, where relative paths are expanded by prepending them with the applications current path.
    Also LabVIEW uses mostly the Windows 32 Bit API, which does provide the current path implementation but does almost not use it in any of its file operations. The use of that feature is mostly reserved for the Windows shell API, which is a higher level API that can as best be described as a collection of various APIs that have been thrown together by whatever some MS developer felt at the moment. You can not by any means call it a designed API at all, and LabVIEW makes almost no use of it, as it needs lower level access, to make its operation similar in its working across all the platforms, LabVIEW can run on.
    So while you can work with relative paths inside your application (and actually should as much as possible to make your application not depend on a particular location) you should make that path absolute whenever you pass it to a function that actually accesses a file somewhere.
    Rolf Kalbermatter
    Message Edited by rolfk on 09-08-2009 11:31 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • I have created two related books in Lightroom 5 (Volumes 1 and 2) but my balance of page numbers is off. So I'd like to take some pages out of one book (complete with images) and paste them into the other. Is this possible?

    I have created two related Blurb books in Lightroom 5 (Volumes 1 and 2) but my balance of page numbers is off. So I'd like to take some pages out of one book (complete with images) and paste them into the other. Is this possible?

    Can you zip up a few of your GoPro images, upload them to dropbox.com and post a share link, here, so others can experiment with them, or do you mean this issue is global to all camera models?

Maybe you are looking for

  • Store a value in variable from Java using Jython

    Hi all, I want to send some arguments to a java program and a small logic will be applied there and it will return a value.I need to capture that result in a variable and to store that in a target column. For Ex: I wrote a java program which handles

  • How to share content across a whole family?

    I know there are other threads related to this, but I'm really trying to understand how to manage iTunes DRM, Home Sharing, Match, etc., across my family's ecosystem of Macs, iPhones, iPods and iPads. I seem to think the following apply: - up to 5 "c

  • How do I set up a separate "sync" profile for each firefox profile?

    I use separate Firefox Profiles for different purposes, each with it's own set of bookmarks. On XMarks, it is relatively simple to have different profiles, but can the same thing be done in Firefox sync? One account, multiple profiles.

  • How to print the label in multiple times

    Hi,         I wrote a program which will display the label. But  I want to display the labels according my input.          Pleae Explain the process How can I get.   Ex  If I give 4 as input number in  selection screen.  that should display 4 labels.

  • Apple tv wireless password all numeric

    I've just purchased an Apple TV and I've run into a problem configuring the wireless connection.  My wi-fi password consists of numbers only.  I'd heard that Apple TV requires an alpha numeric password.  Is there a way to make the system accept a num