Correctly combining an absolute and a relative URL

Hello everyone!
I've been messing around with combining absolute and relative URLS in java and have found the task to be a little more confusing than I originally thought. For example:
/wallpapers/17i/Lotus_Exige_Mk_II,_2004.jpg
http://wallpapers.diq.ru/ru/17__Peugeot_Moonster_Concept%2C_2001.html
Firefox and other browsers see this as: http://wallpapers.diq.ru/wallpapers/17i/Lotus_Exige_Mk_II,_2004.jpg
I don't understand why the /ru/ is taken out; and was wondering if there was already a class written in Java that combined urls, or if someone could explain to me why the end result is not http://wallpapers.diq.ru/ru/wallpapers/17i/Lotus_Exige_Mk_II,_2004.jpg
Thanks

The web page could have a <head> section that contains a [<base>|http://www.w3schools.com/tags/tag_base.asp].
This specifies the base that will be used when resolving urls. It may not be the url of the page itself. For instance it could be that the "ru" bit collects together all the Russian langauge pages parallel to a "en" duplicate that has the same pages in English. Clearly both sets would want to access the same image resources so they have a <base> setting that points one level higher up.
If this is the case and you want to get the url for the images you will have to parse the <head> of the web page and figure out what the <base>is.

Similar Messages

  • TMG / WPAD and protocol relative URLs

    We are using a TMG Cluster (TMG2010 SP3) as a proxy.
    We use wpad auto discover for our clients and that is working fine except that protocol relative urls are not sent to the proxy but use the direct route.
    More and more websites are using a protocol-relative url (eg: script src=//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js ) when we use the "automatically detect settings" option in IE these URL's aren't redirected to the proxyservers.
    And because our clients do not have direct internet access the page doesn't load the script and isn't displayed correctly.
    I probably have to alter the wpad.dat file but I'm stuck in how to do so.

    Hi,
    Thank you for your post here.
    How did you judge that the packets have been directly routed to gateway?
    Could you please configure your proxy to manually point your web proxy server address? Please test it to see if traffic is still routed directly.
    Network Monitor 3.4 is a very useful tool to help us capture the network packets. We need to check if the request you send is packaged in HTTP or HTTPs since just HTTP or HTTPs can be proxy direct to proxy server.
    Best Regards
    Quan Gu

  • ScriptBundles and application relative URLs

    I'm having trouble coming up with a way to bundle javascript files in my environment using .net's scriptbundles.  My environment is setup with one website and about 30 applications configured in IIS under this one site.  I also have about 20 or
    so different custom javascript libraries that provide various features or "widgets" to the applications.  The widget's .js files are located in folders at the root of the site.  Each application may use some or all of these widgets.
    While I have gotten the bundles to work for .js files that are local to each applcaition, I'd like to bundle together the .js files that are external to the application.  This would allow me take advantage of the minifying and help resolve any caching
    issues.
    Is there any way possible to not have to use application relative URLs?
    I have looked at trying to use the CDN option, but that doesn't work, because while in debug mode it tries to use a local version of the widget and there will never be a version local to the app, but there will always be one at the site root.
    I also noticed that you can override the .Include function of the ScriptBundle class.  Maybe there's an answer there, but I couldn't figure it out.
    It seems to me that constraining the files that can be included to just the files located in the application is poor judgment.

    Hello TroySim,
    It seems this issue is related with a web application, I suggest that you could post it to:
    http://forums.asp.net/
    The current forum you posted to is used to Discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection.
    And anyway, it is glad to hear that you find a workaround for this issue.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with automatic logout between secure and non-secure urls

    On my business catalyst page the user login page is located on a non secure url (our site's domain and not worldsecuresystems). When a user is logged in and then views a page on a secure url (i.e. a page to purchase a subscription to a secure zone) it does not retain their login cookie and it appears they have been logged out. This also creates a problem where I cannot pre populate the secure zone purchase form with a user's information based on their account details. Is there a way to retain have both domains recognize the user is logged in to allow the user to freely pass between these domains without having to login twice? I was considering putting the login page on the secure domain and using relative urls for all my links but for some reason some of my pages appear corrupt when viewed on the worldsecuresystems domain so I'd like to avoid this method. Any help would be appreciated.

    Make sure the referrer paramter is correctly set on the form.
    This is the default BC action. But remember the {module_siteurl} will return the host they are currently on. So if this is used on a secure page you'll need to use {module_sitehost} instead
    action="{module_secureurl}/ZoneProcess.aspx?ZoneID=-1&amp;Referrer={module_siteUrl,true,true}&amp;OID={module_oid}&amp;OTYPE={module_otype}">

  • How to identify combination of created and deleted Bank Details

    Hi Experts,
    I will develop a report similar to standard report RFKABL00. The requirement is to display the date, time, vendor number, vendor name, changed by, field name, company, purchasing org, new value and old value everytime a user make a change on the bank details (Bank Key and Bank Account only in XK02).
    The content of field name will be either Bank Key or Bank Account with its corresponding old and new value. Using transaction XK02, I tried to replace the Bank Account of the vendor and saved the data. The created and deleted values can be found in CDPOS using: objectclas: kred, tabname: lfbk and fname: key; but it is difficult to identify the correct combination of deleted and created values. I observed that for non-key fields in LFBK table there are entries for old and new values but for key fields like bank key and bank account they have nothing.
    How will we identify the correct combination of deleted and created values if there are many entries in CDPOS?

    Murali,
    As already specified in your previous thread. You can get the id using source code. or extend the CO and print the value of s2.
    Regards,
    Gyan
    www.gyanoracleapps.blogspot.com
    www.querenttech.com

  • Is there any way to launch another module with a relative URL?

    I'm trying to connect the end of one module to the beginning of another (daisy-chain.)
    I've been trying to do it by putting a button on the last slide and then setting the button to open the other module's htm file. But it seems to only take specific and not relative URLs. This is problematic because my client has the material first on a test server and then on a live server, so the URLs will be changing.
    Is there another way to do this where I can use relative URLs or some other method?
    Thank you!

    Apologies if I misunderstood, and you have already set up Flash Security to trust the publish folder location.  In general, when someone asks a question on this forum about problems getting links to work between Captivate modules the reason is almost always that they are testing the links from locally published files or from a LAN server but they haven't set up Flash Global Security to trust the publish folder location.  That's why it's the first thing I quote.
    Captivate DOES allow you to use relative links to load other daisy-chained content.  For example, if you have a SWF file from one course module calling content from another module in a nearby folder, you can use relative link addressing to open the other file.  The format of the link slashes is different depending on whether you are serving from a LAN or a web server.  The web uses forward slashes.  LANs use back slashes.
    If you ARE trying to test Captivate HTM/SWF content from a local drive or LAN server you must get Flash Global Security set up first. If you intend to serve your content to end users from a LAN, then you have no choice except to have all learners consuming that content to set their Flash Global Security settings to trust the drive or folder containing that content. This is not a Captivate issue, it's a Flash Player issue, and it's the result of security measures taken by Adobe several years ago to prevent Flash content from being used maliciously as a virus. The unfortunate downside is that it also limits the usability of Flash content if served from a LAN. But you need to remember that Flash was really designed as a web-based format. So you find that content served from a web server instead of a LAN server has no issues with Flash Security.

  • How to convert relative url to absolute in URLPortlet?

    Images and links don't work becase they are not getting filtered to absolute urls. <baseHRef> doesn't seem to do it. Isn't URLServices supposed to automatically convert all urls to absolute?

    URL Services internal identifies relative URL and converts them into absolute URL's.
    It uses <BASE HREF="URL"> if available, otherwise the uses <pageUrl> as base URL and constructs the absolute URL's.
    Please post URL to which you facing problem, so that we can find fix this error.

  • SharePoint sites and the use of Relative URLs

    In our sites the designers coded all URLs as FQDN  (e.g.
    http://servername/sites/mysite1....). This includes URLs in webparts too. We now want to transfer the site to a new SharePoint box, of a different name, and power down the original box.  We ran a test and, sure enough, the FQDN URLs
    hardcoded in the copied webparts point back to the original box. This means when the old box is eventually powered down the new one won't work. My question is this: should our Designer have used relative URLs (e.g.  ../sites/mysite1) everywhere
    instead of referencing the server name?
    TIA,
    edm2

    yes... absolutely.
    Better yet, there are special URLs that designers can use, which are relative to the SITE COLLECTION, or even the SITE/SUBSITE... which are really better to use, should you ever need to copy the site collection, or change its URL.
    Also, SharePoint should use an ALIAS name, not a server name.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • How to remove bullets and spacing for url links in the Related Links iview?

    I tried to look for a property that I can edit the look-n-feel of the url links in the Related Link iView using "Theme Editor".
    All I need is to remove the bullets and increase some vertical spacing between the links.
    Currently, it looks like this:
    URL iView A
    URL Iview B
    I go through the whole section of Related Links properties, none of them seems to do what I want.
    Here are the list of properties in Related Link section (of Navigation Panel):
    Link Color
    Text Decoration of Link
    Hover Color
    Text Decoration of Hovered Link
    Initially, I thought "Text Decoration of Link" should be the right property I should look at. But there are a drop-down with 5 options: None, Underline, Blinking, Overline and Line-Through, which really can't achieve what I want.
    Thanks for advice.
    Kent
    Post with Diagram Illustration:
    <a href="http://sapnetweaverforum.blogspot.com/2006/11/how-to-remove-bullets-and-spacing-for.html">How to remove bullets and spacing for url links in the Related Links iview?</a>
    Message was edited by: Kent C.

    Hi, Kai.
    I checked the Related iView properties (URL Template), I don't see what layoutset it is really using. I am not sure, is that a layout set apply to the Related Link Iview?
    For the regular KM iView, I will see what Layout Set I want to apply, then I can go and change the properties (of layout coontroller, collection renderer & resource renderer)you mentioned. But for this Related Link iView, I really don't know. I guess it may be in the code itself.
    If there is a layout set for Related Link iView (or the place to apply layout set to it), can you point to me which one is that? (I did a search through the layout set names, I only find the AppQuicklinkExplorer (I used this for Dynamic Nav. Link iView before), if I can aply this layout set to Related Link iView, my problem will be solved.)
    Thanks for help.
    Kent

  • I have removed and re installed I tunes and all related apple products. 5 times and still get message not installed correctly or error 7 or to install english version. I give up help

    I have removed and re installed I tunes and all related apple products. 5 times and still get message not installed correctly or error 7 or to install english version. I give up help

    Have you worked through the tt2 user tip:Troubleshooting issues with iTunes for Windows updates this is the best source on resolving iTunes for Windows issues.

  • Billing experts: Combining order related and deliv. related

    Hello Billing experts,
    I am just wondering if it is possible at all to combine order related and delivery related to ONE billing document (one DMR and one delivery note with the same payer).
    Or do we have to use Invoice List? I can't make it work.
    Same payer, same Payment Terms and different pricing procedures(with RL00). What other fields that must have identical values, so the billing documents will be grouped in the invoice list?
    Thanks alot in advance!
    Best Regards,
    Tuan Vo

    Hi Tuan Vo
    Since there are many other criteria, its not a viable Solution to combine, order related and delivery related to one billing document even though its possible in SAP.
    The following prerequisites must be met for a Single Invoice from Delivers and/or orders:
    1) the header data appearing in the billing document must agree
    2) the split conditions specified do not apply
    As you see, the Delivery related Invoice has always a pre-checking with the Goods Issue status where as Order related doesn't have to.
    Hence Invoice lists is the option given by SAP.
    However, with an intelligent Copy Control routines between the documents should do the trick.
    The system combines documents with the same customer number, proposal billing type and sales organization, and attempts to include them all in the same billing document. If the preconditions are met, then a single invoice is created for the deliveries and/or orders.
    Note that When creating several billing documents, user exits can be used to reset the header data, so that more can be combined than in the billing due list and later combine to single document.
    There are other fields like Material Group, Billing Dates, Billing Document Type, Item categories which can force for an Invoice split.
    Please let me know if it helps.
    Best Regards
    Ajay Kumar Veeranki

  • Relative URLs and Application Context

    How do you handle rendering relative URLs so that:
    1. Your application is independent of the application context it's deployed to
    2. You don't end up with lots of ugly code in your views
    3. The solution will work on any J2EE server
    I have several approaches, but I can't find any "best practices" discussions on this subject so I thought I'd start one.

    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    "> Home</a>
    My main problem with that is that it's ugly as sin.                                                                                                                                                                                                                                                                                                                                                                       

  • Generating relative URLs in 12.1.3 menus

    Does anyone know if it is possible to get R12.1.3 to generate relative URL for all menu items?
    The new AJAX based menus are returning absolute URL for all menu item links.
    If this is the wrong forum please let me know
    thanks

    Hi,
    ERROR: I/O or zip error while attempting to read entry oracle/xdo/parser/schema/XSDIdConstraintTable$NodeTable.class in zip This error indicates one of the following:
    - Permission are not set correctly, so please verify the permissions -- See (Note: 339762.1)
    - The file is corrupted or missing, and you would need to find the file and copy it to the appropriate directory -- See (Note: 299723.1, 299964.1, 343639.1, 746167.1) for examples
    If none of the above helps, I would suggest you log a SR.
    Thanks,
    Hussein

  • How to set up use of relative URLs for a BSP application

    Dear all,
    I need to access a BSP application through our external portal.
    This is failing because generated URLs are absolute URLs (they mention physical server name, not known of course on the internet) where they should be relative URLs (they use external portal URL as prefix).
    How to set this up?
    I'm logged on http://myportal.com/irj/portal and want to call a BSP application. To build this page, my internet client (Internet Explorer) tries to get elements from the server. Looking at HTTP trace, I can see that my IE is trying to reach the physical server, not known on internet of course, then page loading fails.
    Ex absolute URL : http://myservername.domain.com/sap/bw/[...]/image1.gif
    This is the behavior I can see at the moment.
    Relative URL : http://myportal.com/sap/bw/[...]/image1.gif
    This is what I'd like to see.
    Many thanks in advance for your help.
    François

    Any idea ?

  • Sharepoint 2013 Wiki Page - Links in content rewritten to relative urls

    We have an issue where on all SharePoint 2013 wiki pages any URL to items within the site containing the wiki page are rewritten to be relative URLs. This causes a huge problem when we surface these pages and a snippet of their content through a search web
    part because the links fail being relative to the wiki page itself. To further illustrated with an example.
    A site collection root page http://www.sp2013.com/default.aspx contains a search results web part returning all wiki pages in the site collection. There is a custom display template that renders
    the linked title of the wiki page and the first 500 characters of formatted text (html) of the wiki page.
    A wiki page is created in a sub site (sub1) called wiki1 (http://www.sp2013.com/sub1/pages/wiki1.aspx) the text of the page contains:
    "Check out our new library: Document Library"
    Document Library is a hyperlink to (http://www.sp2013.com/sub1/Document%20Library/Forms/AllItems.aspx)
    Upon saving the wiki page the link is reformatted to be /Document%20Library/Forms/AllItems.aspx
    From the rollup web part at http://www.sp2013.com/default.aspx the relative url in the snippet text of the display template evaluates to
    http://www.sp2013.com/Document%20Library/Forms/AllItems.aspx which does not exist.
    I have attempted modifying the source of the wiki page as well as the link in the ribbon however upon save of the changes the link is always modified to be relative. Any assistance is appreciated as this is extremely frustrating. Thank you.

    Hi JonesEJ,
    According to your description, my understanding is that SharePoint converts a absolute URL to
     a relative URL when you save the wiki pages containing the URL.
    This is actually the preferred behavior in SharePoint and on the web in general. SharePoint saves all absolute URLs for the wiki content as relative. It only does this if the URL matches the URL for the web application for that current wiki
    site.
    There is no OOB way to change the relative URL back to the absolute URL. For your issue, you can try to use
    SPSite.MakeFullUrl() to convert it back.
    There is a similar post for your reference:
    http://sharepoint.stackexchange.com/questions/62887/absolute-urls-converted-to-relative-urls-when-saving-item
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

Maybe you are looking for