|
| Hi,
I'm using
FacesContext context = FacesContext.getCurrentInstance();
ExternalContext exContext = context.getExternalContext();
HttpServletRequest request = (HttpServletRequest) exContext.getRequest();
String url = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ request.getContextPath();
any better solution ?
thanks
> hi everyone,
> can anyone give me some advice on how to create full
> url's (including http://, hostname, etc) to image
> files that are inside a portlet's .war file? i'm
> using response.encodeURL to do that, but it only
> creates a relative path, so it creates
> "portletname/folder/image.gif" but what i need is
> "http://app.domain.com/...lots_of_stuff.../folder/imag
> e.gif"
>
> the reason i need to be able to do this is because
> i'm trying to embed a Java applet in my portlet, but
> the Java applet needs to have absolute (not relative)
> links to all the images and resource files that it
> accesses.
>
> any help would be greatly appreciated.
|
|