Image displays in some jsp files but not others

OK, I have a jsf jsp pages js tag for my application that occurs in several jsp pages:
<tr>
   <td>
      <jsp:include page="/includes/footer.jsp"/>
   </td>
</tr>     footer.jsp has an image tag like this:
<td align="left"><img src="images/logo.jpg" alt="X Systems"/></td>     The jsp files are in a directory which is under the base directory like the include and image files. For some reason, in one jsp page the logo.jpg file does not get displayed. As I understand it, the application server jboss/tomcat resolves the image files. Why would it be displayed it in one page and not another?

You are using a relative link to access your image.
That means it will look for your image relative to the page it last served.
If you ask for http://myapp/root.jsp, it will locate http://myapp/images/logo.jsp
If you ask for http://myapp/module/index.jsp it will locate http://myapp/module/images/logo.jsp
If you right click on your image / broken image placeholder and look at its properties, you should be able to see the url which it is trying to fetch the image from.
The client will resolve relative links from the address url it last accessed. It knows nothing of any serverside forwards/includes that you might have done.
So if you access http://myapp/action and forward to /moduel/accounting/balanceSheet.jsp it will still treat the url as http://myapp/action for resolving relative links.
As far as the client is concerned, the root is /
As far as your web application is concerned, the root is /myapp (or whatever your context name is)
Because of this you can't give your images an static absolute url, because you would be hardcoding the context name into your jsp.
Alternatives
- use something like <img src="<%= request.getContextName() %>/images/logo.jsp"/>
- use a tag library to hide the implementation of option #1 (like struts tag html:img)
- only use relative links, and always specify a html <base> on your page to resolve relative links from.
Hope this helps,
evnafets

Similar Messages

  • Preview will combine some pdf files, but not others, what gives?

    After years of PC loyalty, I switched to a MacBook Pro four years ago and found heaven. Most of that time I've blissfully worked my arse off at my office on a powerful, simple, wonder of a machine/OS. However, the latest update to my Preview app seems intent on ruining one of my favorite programs. Often I take a pdf file (a cover sheet) and add technical data pages to the pdf by combining other pdf files (drag and drop). This used to work seamlessly without hitches. After the latest update however, I cannot add certain files without an act of congress! Some files stubbornly refuse to combine, in which case I must duplicate the host file, or the files being added (often several times), saving and removing versions before it magically works! Granted, I'm no wiz and I'm quite sure I'm overlooking a simple step that will clear this confusion. Can anyone help? The lovely cash vampires at Apple refuse without payment. Thanks in advance.

    GPFSarah wrote:
    I'm in the process of transferring my iTunes from Windows 7 to my Mac to sync with my new iPhone 5s. I used an external harddrive to transfer iTunes, and almost everything worked smoothly.
    Copy the entire /Music/iTunes/ folder from old computer to /Music/ on new computer.
    However, there is one album that's giving me trouble. About 2/3rds of the songs from the album refuse to be transferred into iTunes, and I have no idea why. All the songs in the album are the same format (.wma) and all of them could be read in iTunes on my Windows 7 system
    They could be added to iTunes but iTunes converts them as iTunes cannot play WMA files (as Brett mentioned).
    You can first add them to iTunes on your Windows computer, which will convert them to AAC & then copy the converted files to the new computer.

  • I can open some older numbers files but not others. I get a message that says I need a newer version of numbers.

    I can open some older numbers files but not other. I get a message saying I need a new version of numbers. Why would some files open and not others?

    SK,
    Here's the deal. If you ever open a Numbers file with Version 3, the file is converted to Version 3 and can't be opened again by Version 2. Version 2 and Version 3 are undoubtedly both on your machine and they look so similar that you may not realize which you are using. So, there are two steps to getting into trouble.
    1. Open a Numbers 2 file with Numbers 3, edit it and Close it.
    2. Try to open that file with Version 2. You ill get the error.
    To always get it right, find the file you want to open in Finder, Right-Click it and choose Open With... and pick Version 3 from the drop down list.
    If you have a file that you prefer to use only in Version 2, always use Open with... Numbers 2.3.
    Jerry

  • Source Reformat menu item disabled for some XML files, but not all

    For some reason, the 'Reformat' option isn't available for some of my XML files (in Source menu it's disabled, in the right-click pop up menu it's not even there). For example in my META-INF folder it's enabled for .wsdl files but not .xml files. In the same project, it's enabled for all .xml files in the WEB-INF folder.
    Any idea what's going on?
    TIA

    Thanks to everyone for their response. But - it is NOT a copyright issue , it is NOT a DRM issue, it is not a Faber College double secret probation encoding issue.
    This is a simple .wmv file, that I have copied, burned, created a disk image, made a copy of and sent to the UK, Germany, Ireland and even New Jersey. It has been played on a MacBook Pro, a MacBook, a Dell whatever, a Sony stand alone DVD player, an LG DVD player. At least three nieces or nephews, and at least 2 canines have put it through ISO 9XXX rigors.
    The problem is that Apple Quick Time 7 Pro with Flip4Mac Pro "can't handle it"
    It opens fine, it plays fine --- but when I try to "output" it via the FILE menu - all of the options
    Share ...
    Export ...
    Export to Web ...
    are greyed out.
    I know nothing abour codecs and wrappers but I tihnk that this is the problem.
    What should I know about the file?
    Ffor example, years ago, all you needed to know about a Mac file was the "Creator" and the "Type" - both were 4 character codes. something like ADOB for Adobe and PMK2 for Pagemaker 2.0.
    Any help identifying the file and what I can use to get it onto my iPhone will be appreciated.
    Thank you.

  • Problem viewing streaming video in some wifi networks, but not others

    When I am at work (university), I can not view YouTube videos or video streaming from news sites such as cnn mobile on my ipod touch 2g.
    <m.cnn.com/videos.jsp?ckey-cnn)06#__1_>
    When I called Apple support, they had me reset-restore. I still had the problem. I went to the Apple store Genius bar and the problem no longer existed, the videaos downloaded and played from both sites!
    But at my diner and at work, I get the message, "This movie could not be played" in a popup box with an OK button. The same message appears if I use the YouTube application. I click on any video, and the same popup appears. In Cnn the popup is preceded by a shaded capital Q that looks like the blue Quicktime Q; in Youtube the pupup is preceded by a YouTube icon in gray with the "Tube" surrounded by the rounded rectangle, their icoon...
    At the Apple store the popup never appeared, and the videos downloaded and played.
    I have no trouble playing movies I have downloaded from iTunes.
    I did not have this problem when I initially got my iPod Touch, and I think it appeared after one of the last two system upgrades, but I am not sure.
    I am curious that it the problem happens at two places, my diner and at work.
    The speed of my wireless work network, as judged by the ipod app speed test is 9915 kbps download and 6971 kbps upload, so plenty fast.
    The first time I noticed this issue was with the application "At Bat Lite" which also won't play video highlights at work.
    I do not have WiFi at home
    Any thoughts about what would cause this lack of functionality apparantly only at some networks but not others?
    Oh, one more piece of data: at work a Macbook will play YouTube both on ethernet and using wifi...
    Thanks for any thoughts or suggestions,
    Paul

    It seems I have two networks available at work, one is behind our firewall, and I login to it. This is the network that I can't view streaming video. There is also a "Guest" network that I don't need to login to. This one works with the YouTube and the news site videos.
    Thus, I conclude there is a setting that WiFi network administrators can invoke that specifically can block streaming video on some protocols (whatever the ipod touch uses) and not others (whatever the Macbook uses). But the same router hardware supplying the Guest network does not block these protocols. Presumably this has to do with security on one side of the firewall(?)
    Anyway, apparently outside of the WiFi controls available in the ipod touch settings.
    Weird...
    Paul

  • Why can I highlight some pdf files and not others

    Why can I highlight some pdf files and not others

    Highlighting only works on text documents; a scanned document (image) cannot be highlighted.

  • Background image displays locally in HTML5 template but not when published

    I have used an excellent HTML5 template which uses JavaScript to display background images. However while this file works locally it doesn't when published. The site structure is sound and I notice this happens with the source files I downloaded also so it's nothing I have done in my build which could have caused this.
    This is the link to my site, everything is fine except the background image not showing.
    http://www.khawkinsdesign.com
    Any ideas, as I say fine locally, not fine when published?
    Message was edited by: Kyle Hawkins

    Hi Kyle,
    I realise you posted your question a couple of days ago but it looks like your background image issue may now be fixed?
    In any case, your site has a few issues. Not sure who told you the template was HTML 5 but they might be yanking your chain. There is nothing HTML 5 about the code used and the DOCTYPE is from HTML 4. As such, some of the code you have used is throwing up errors - some related to the DOCTYPE and some where you haven't closed the tags:
    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.khawkinsdesign.com%2F&charset=%28detect +automatically%29&doctype=Inline&group=0
    <ul id="footer-nav">
    <li><a href="index.html">Home</a></li>
    <li><a href="portfolio.html">Portfolio</a></li>
    <li><a href="about.html">About</a></li> /*The closing tag is missing in your code */
    <li><a href="contact.html">Contact</a></li> /*The closing tag is missing in your code */
    </ul>
    It would be best to amend the errors but some might disappear when you add the HTML 5 DOCTYPE in to your code. Things like your lack of "type" on the sources is a required v4 attribute, but not in v5.
    <!DOCTYPE html>
    Have a read through this for more info - this is a great resource for everything HTML 5. http://diveintohtml5.info/
    Rik
    EDIT:// It seems that the DOCTYPE is the 5 version on all but the home page so you may only have one to correct. However, there are still no HTML 5 elements used to take advantage of the new DOCTYPE.

  • Why does some artwork embed into the file, but not others?

    Hey everyone.
    I'm running iTunes 11.3.1. I'm incredibly obsessive about having organised files and one thing in particular I want is album artwork embedded into the music file itself, not just on iTunes. The problem I have is that the artwork will embed for some, and not for others - even if I use the exact same methods:
    I use the following for getting HQ covers: http://bendodson.com/code/itunes-artwork-finder/index.html
    I will then click on the high resolution version, copy it to clipboard, command-i to get info of the individual tracks and manually paste the cover into every track on the album. When I then go into Finder to see if it has embedded, I find that for one album it has worked perfectly; but although I use the exact same method, it won't work for another album even if they're exactly the same file type.
    (I know I can save myself time and select all the tracks, command-i and paste the artwork to do it in one go - but I find I get just as much of a mixed bag. I.e. sometimes it works, and sometimes it doesn't.)
    I am literally at the end of my tether and I can't figure out what I need to do differently, any help is appreciated. Thanks.

    I have encountered exactly the same problem and frustration :-)
    Although I can't offer a definitive reason why, I did notice that the problem tracks typically had a higher resolution image attached in iTunes. I have used Preview to reduce the resolution to 600 x 600 (standard iTunes size) and it worked.
    Now, I have no idea if it was the resolution or the fact that I was re-saving a fresh version of the JPG (which may have stripped out whatever was causing the problem), but the process of tweaking the file to 600 x 600 and re-saving has worked for me.

  • PDF Software causing problems in sending some PDF files but not all?

    I have been having problems sending some emails with PDF attatchments, they are being returned more and more frequently.  I've spoken to our server host and his answer is as follows saying that the problem is we are using "cheap PDF software" which is why I can send PDF's via Gmail or Yahoo but not through our server.  He suggest we buy a more expensive software or using Gmail for our important bids and invoices that are sent daily.
    My question is:  Is this even close to what could be causing the problem.  We are using Adobe to create our PDF's using our HP CM1410 or the Neat Scanner.  The Neat is a new device but the problem was ongoing before the Neat Scanner was added.
    Our IT person who set our network, hardware and software says it's the server and he's never heard of this being an Adobe problem.  So we're stuck not knowing who to believe

    There are several potential problems. It could be that your e-mail client is not encoding the PDF properly, but looking at it as an ASCII file (7-bit characters). The encoding is not as much of a problem anymore, but still a potential issue. The structure of the PDF that you are getting from the scanner may be corrupt. You can use some of the preflight scripts to check the integrity of the PDF. You might even try saving as a new PDF to see if the 2 versions work differently.
    It might be better to print the proposals you mentioned to the Adobe PDF printer and get better quality proposals than you would get with a scan. That would also probably avoid the problem you are having.

  • IPhoto downloads some pix & video but not others in the same format

    For the past two weeks iPhoto is giving me error messages on some of the photos and videos I try to import from my SD card. I never had this problem before but it will import some of the photos and MPEG-4 videos but at the end, it lists all the ones it can't import.
    For the photos it lists them all as below with the message that they are unreadable files. Then it says "The following files could not be imported (they may be an unrecognized file type or the files may not contain valid data.)
    /Volumes/NO NAME/DCIM/100SSCAM/STH73614.JPG
    /Volumes/NO NAME/DCIM/100SSCAM/STH73615.JPG
    /Volumes/NO NAME/DCIM/100SSCAM/STH73616.MP4
    /Volumes/NO NAME/DCIM/100SSCAM/STH73617.JPG
    As you can see they all have valid file type extensions. It's particular odd because I downloaded a very short video clip I shot with no problem but did not download the one I shot just seconds before because "this is not a movie file."
    Curiously I was able to download the pix and videos on my work Windows computer. But I had to email them to myself in order to be able to get them into an iPhoto album.
    Once I get these latest ones off the SD card I will reformat it. I assume the problem is with the card, right?

    Jane:
    Once you get the files off the memory card use the camera to reformat the card before using again. Other users have reported similar issues and a reformat in the camera solved their issue.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier versions) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. There are versions that are compatible with iPhoto 5, 6, 7 and 8 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    NOTE: The new rebuild option in iPhoto 09 (v. 8.0.2), Rebuild the iPhoto Library Database from automatic backup" makes this tip obsolete.

  • Trouble loading some web pages but not others

    having a little trouble lately...
    For some reason safari and, well, any other browser, come to think of it isnt work on particular pages.
    Example. The other day google.com wasnt coming up just spinning its wheels then saying:
    Safari can’t open the page “http://google.com/” because it could not connect to the server “google.com”.
    Another example: Safari could not open the page “http://cbgundaker.com/” because the server stopped responding.
    I called my ISP and sat thru 2 hours worth of trouble shooting and got nowhere. They thought it was a DNS issue but I can reach the sites from other machines in the network so it looks like it is only effecting this particular powerbook. I've sat two machines down next to each other and it'll work on one but not the other(same wireless or wired network). annoying.
    Anyone have any ideas?
    Thanks,
    p

    pardon me for butting in, this problem is driving me crazy.
    i just tried your dns thing, no effect.
    what i can't understand is why does my iBook display all 5 pages that i can't display on my iMac? i visit these sites everyday
    -the bookmarks are synced between the two, iBook and iMac use same internet
    -i copied the iBook plist for internet and safari over to my iMac-no change
    -i did all the resets, clear cache, disk utility,ditch plists
    -safari, camino,opera,firefox,shirra do not open these 5 pages
    -macworld.com opens fine, macworld.com/news/ does not
    -my admin account does not display these 5 pages
    -i turned on airport, connected to someone's unprotected network and tried the sites to no avail (i have my own wired internet connection)
    -it hangs on the 2nd to last item in the progress bar, ie "8 out 9 items"
    -this all started sometime after the last security update and before10.4.6
    i am at wits end!

  • IPhoto6 likes some photo's but not others

    Hi All,
    I've a real problem with iPhoto and thought some of you gurus could maybe help. I've around 3500 photo's in my library. I populated my library by importing photo's from my folders on my Windows PC (networked to my Mac) and more recently directly from my camera (all done as I'm supposed to - through iPhoto). The photo's are all there, no problems opening iPhoto etc - the application is swift and neat. Now here's the problem.
    I have created a number of albums and have organised my photo's (or am trying to) by album. I'm dragging the photos from the main library into the appropriate album, however, some photo's do not like being dragged and dropped at all - they eventually do (after say 5 minutes of spinning beach ball) place a copy (or reference to main original file) in the album. There may be some reason behind this but from my perspective it appears random - there's no telling which photo iPhoto will and will not like. This reduces my productivity heaps - what should be a very slick and easy task turns into a hair-pulling, eye-poppingly frustrating one.
    This of course also mucks up all the other iLife applications eg iDVD - I'm using the albums to create slideshows - dragging and dropping the albums to a slideshow created in iDVD easy? Nope - will not import some photo's. Same goes for iWeb.
    There should be no problems with imported photos as I kept all photo's on my old PC organised in a similar way to the Mac does anyway ie by month and then by original and by edited.
    I've also tried cleaning thumbnails and entire library (marginal performance achieved) and running onyx to clean permissions etc. I've taken out RAW files and movies taken on camera's to see if that would work...nope. Running out of ideas now...
    MacBook Pro   Mac OS X (10.4.7)  

    do you know if it is possible to open multiple instances/windows of iPhoto
    As Terence stated, no. The best you can do is to use iPLM or iPhoto Buddy to quickly jump between libraries. Or use iTLM to merge the one library into the other and keep them all in one. In any case take a look at the tip at the end of my signature. It may help protect you against damaged database files which has been an all to common problem here.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.

  • My Mac Mini will read some commercial DVDs but not others.

    I have a Mac Mini running Snow Leopard 10.6.8 on a 2.53 GHz Intel Core 2 Duo processor. I've had it for a couple of years now and just recently decided to run one of the video ports out to a wall mounted LCD TV for viewing both internet tv and DVDs. However, turns out my DVD player (SuperDrive, and rarely ever used ... maybe 10x since I bought the thing) won't read certain DVDs. For instance, it will mount and play Charlie Brown's Christmas, but not Pirates of the Caribbean. It appears to be a 'new dvd' vs 'old dvd' issue. Is that a real issue? Is there software I can install that would cause the drive to mount and play my newer DVDs? I'd appreciate any advice here. Thanks.

    I have a new mac mini w/o superdrive but I can play all dvd's on the superdives in my MBP and my iMac. The MBP is new but the iMac is 2007 vintage. You may want to try cleaning the lens in the drive. Radio shack and others sell cleaning disks.

  • FCP recognizes some h.264 mp4 files but not others

    I'm having a particularly frustrating experience with Final Cut Pro 7 at the moment. I've been working on a project for a while now, and I've been importing and cutting with mp4 files that are in h.264 codec with AAC audio. It's been working just fine for a long time now.
    Now, I have three more video files to import into the project. They are THE EXACT SAME format: mp4, h.264 codec with AAC audio. Data rate is pretty much the same. Technically, everything I can see about them, format-wise, is exactly the same.
    It's not recognizing them. I get "File Error: Unknown File".
    I've tried playing them in multiple players. Quicktime, Quicktime 7, VLC... they all work just fine. The inspector in Quicktime tells me the EXACT SAME format information as the files that are importing just fine.
    Can someone PLEASE shed light on what the **** is going on here? Why are all the rest of h.264/AAC/mp4 files that I'm importing working just fine while these three are not? I've looked at their logging/format information... it's all exactly the same. There's no perceivable reason that I can find why Final Cut is singling out these three files not to recognize. I thought maybe something had changed with Final Cut and it no longer works with h.264 or mp4 or whatever... but all the other files I already imported are still working just fine. And I can still re-import them just fine. So it can't be that FCP just doesn't recognize MP4 or H.264 or AAC, because it's recognizing it just fine with all the other files. Again, they're all in the EXACT SAME format!
    And yes, I've tried re-coverting these files. I've converted them using different programs. They always end up working fine for playing in all the players I have, but when I go to import them into Final Cut, suddenly they ain't working. I'm pulling my hair out trying to figure out why and I'm completely clueless.
    Has this happened to anybody else and what did you do? I know I can just try converting them to another format, like ProRes or Apple Intermediate... but that would take up more space on my computer... plus, it's just the mystery of the situation that's really getting to me right now. I want to know WHY it's not working! For the life of me, it doesn't make any sense.
    Also: I thought it might have something to do with Perian. I recently uninstalled and reinstalled Perian. Since I did that, Perian hasn't been working very well. Quicktime doesn't play the audio in mkv files, for example.
    But if Perian not working is preventing FCP from recognizing THESE mp4/h.264/aac files, then why are the rest of the mp4/h.264/aac files still working just fine? Again, it just doesn't make any sense to me. It's like FCP got picked on by these three files and is holding a grudge.

    I know h.264 is not ideal. And you're right, I have had issues with sync on export and such that I've had to deal with. But it still worked. I was able to import and edit with the files, despite having some glitches along the way.
    Now it's just plain not importing. And I have no idea what changed. Final Cut didn't change. It's still importing all the files it likes just fine. They're mp4/h.264/aac, and they import. These three files that aren't importing are the SAME format, but Final Cut doesn't like them for some reason. I would love to know what that reason could possibly be. What could possibly make one mp4/h.264/aac file import, but another one not?
    JUST talking about importing. Not editing or exporting.

  • What is the Compatibility Tab grayed out for applications on some network shares, but not others?

    I have a network share with an executable file located in it. If I browse to the share by UNC path from a Windows 7 pro workstation and go to the compatibility tab of the .exe, the options are grayed out.
    I have another network share with an executable file located on it. This share and workstation are at a different location, unrelated to the first example. If I browse to the share by UNC path from a Windows 7 pro Workstation and go to the compatibility
    tab of the .exe file, the options are not grayed out, and I can check or uncheck what ever I need to.
    Both shares are located on a Server 2008 R2 system w/sp1. Both workstations are joined to the same domain as the server they are connecting to the UNC path on. Both shares have given the user connecting full access on the smb sharing and ntfs sharing.
    Someone please tell me how to make the compatibility tab not grayed out. Here is a screen shot of the comapatibility tab of the .exe file from both shares:

    Hi,
    You can use
    Troubleshoot compatibility to set the application to Compatibility Mode. 
    You can right-click the application’s shortcut and click Troubleshoot compatibility.
    Please refer to the similar thread and the third-party article below:
    Compatibility mode greyed out on exe that is on a mapped drive???
    http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/compatibility-mode-greyed-out-on-exe-that-is-on-a/03c93e47-3d66-485c-b28f-73d06bc793d5
    Windows 7: Compatibility Mode
    http://www.sevenforums.com/tutorials/316-compatibility-mode.html
    In addition, since it is related to windows 7, you can ask in the forum below for further assistance if the issue persists:
    Windows 7IT Pro Forums:
    http://social.technet.microsoft.com/Forums/windows/en-US/home?category=w7itpro
    Best regards,
    Susie
    Thanks, but I read that link before I posted this. Even by running the compatibility wizard, you still can't edit the compatibility settings on Windows 7.

Maybe you are looking for