1 Reply Latest reply on Apr 29, 2007 11:39 AM by Stephan Kleine

    How to produce full http:// URL ?

    henrik lindberg Apprentice

      Hi, I need to manufacture a URL and show to the user as text, and naturally I don't want the first part to be hard coded but reflect where the application is deployed.
      I am sure there is some embarrassingly simple way to get the "base URL" or whatever it is called - can someone help me out?

      As an example - say I want the URL to what this would produce:

      <h:outputLink value="/mysite/animage.jpg" />
      

      I.e. the "http://localhost:8080/mysite/animage.jpg" if running locally in development and "http://somewhere.org/mysute/animage.jpg" when deployed at "somewhere.org".

      Regards