WebSphere Portal Server - Re: creating full URL's to resources within WAR file?

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > July 2006 > Re: creating full URL's to resources within WAR file?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: creating full URL's to resources within WAR file?

2006-07-28, 7:30 am

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.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com