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
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 advanceGuess 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, -
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?
ThanksAdam 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. -
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!
FrancescoHi 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 -
Defining virtual path for images to be visible without specifiying path(AS)
Hi,
I am running a report (Version 10g) which have an image (Read from file = yes) item with source "Function column" that returns an image name. Ex. "11.gif"
I am recieving an error that the applications server cannot find the image "11.gif"
Image 11.gif is stored in a directory on the Applications server "D:\photos".
Where should I add the directory path "D:\photos" so that the reports will view the image?
ThanksNo need to define a virtual path similar to what's done in forms 10g. An entry in the registry key 'REPORTS_PATH' is enough!
-
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 BrianHi
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) -
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? -
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. -
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,
KhuemyWhen 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,
-
Reference Images in Relative Path
Captivate 2 allows you to export the background images out
and then link them in so it is easier to update the images, but the
paths seem like they have to be absolute only. Is there a way to
use relative paths instead of the absolute path? I have several
projects that need to be localized into different languages and
this is one of the things that is not allowing us to effectively
use Captivate 2 for the project. Any help would be greatly
appreciative.Hi again Hyp30
Okay, I have to ask you (and others) for a huge favor here.
You have hit upon something I strongly feel should be part of the
next version of Captivate. That typing layer. You are absolutely
correct that this item cannot be changed. Not only that, but if you
make a typo, Captivate also records that! Sooo, in my not so humble
opinion, what would be
MUCH more useful to us is if the developers created a very
basic and very simple text animation we could use. Simple typing
text. Notice all the animations we have. 88 of those puppies I
think! Why we have fish nibbling characters away, letters flying
here and there. Yet no simple typing text. If that were available,
we could forego the typing layer and simply use an animation.
So, if anyone else feels as strongly about this as I do,
please submit a request by
clicking
here. I suggest this because until the development team hears
from enough folks, it's not likely to happen.
Now, for a suggestion. I'm not sure I'd simply reuse the same
movie for different localizations. If it were me, I'd maybe have a
project folder where the projects are stored. Then a folder for
each main project. Then I'd click File > Save As and have
multiple flavors of each project so I could keep the localizations
separated.
Cheers... Rick -
Screen Painter Image Button cannot set relative path
Hi,
I am using screen painter to create a UI form and i put image into each button. The form can run properly in my PC due to the image path is under my local path. However, the button is gone when i install the UI form in other PC. When using button object in screen painter and it not allow me to set the relative path. Anyone can help??
Cheers,
AnnaHi Gianluigi,
Thanks for your reply. However, i did try to rename the .srf file to .xml file and change the path to the following
<b><specific image=".\test3.jpg" /></b>
But the program didn't work. But if i change it to <b><specific image="c:\test3.jpg" /></b>, give it the exact path then the program work again.
Do you have any idea on it?
Anna -
Is Image File path of Menus element support relative Path?
hi,all
absolute path is OK!
but relative path no support!
how to support it?
thanks
tonyHi Tony,
The image file does support relative path but it requires a little coding.
Please have a look at this thread:
https://forums.sdn.sap.com/click.jspa?searchID=3854863&messageID=1041573
Kind Regards,
Owen -
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.
Maybe you are looking for
-
I used to be able to burn a selection of photos from my iPhoto library onto a CD-R disc. Today I inserted a new blank disc and was shown a message that there was insufficient space for my chosen year of photos. Even when I reduced the date to include
-
My headphone are not functioning correct
Ok, recently i just found this forum and im glad to post my problem here. I am using SB Li've! 4., everything is working fine except my headphones. It's like only my Right side is working and my left side is not working when i plugged the plug into t
-
Exception Handling of JboException with Struts Jun 25, 2003 9:46 AM
Hi, I am using BC4J with Struts. The struts <html:errors/> tag displays all the exception messages generated by ActionErrors and JboExceptions automatically. The problem i have is, I get a Jbo-26041 exception when i try to create a duplicate primary
-
CSS question on sidebar heights
Just going back to a site I started a while ago, and am going to have pages with a centre section and two sidebars - but don't think I'm sure on the best way to ensure the sidebars and the main content are the same height. I've been trying with putti
-
Please fix the auto-delete bug
* I've set ALL my podcasts to "Do Not Auto-Delete" * My podcast prefs are check "Manually" / "download most recent" / keep "all episodes" * I listen to a portion of a podcast on my ipod (NOT all of it) * I updated my subscriptions * I sync the iPod *