This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes get the absolute url from JSP or servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "get the absolute url from JSP or servlet" Watch "get the absolute url from JSP or servlet" New topic
Author

get the absolute url from JSP or servlet

Ashraf Fouad
Ranch Hand

Joined: Oct 07, 2001
Posts: 80
Dears,
I have small problem, I have my web application deployed on SUN ONE application server and working fine, it is now moved behined iplanet gateway which is changing the URLs of images and forms, ..... to something secured like this.

Example:
Before gateway:
http://servername ort/context/images/hello.swf

After gateway:
https://gatewayname/http://servername ort/context/images/hello.swf

I use root relative context path in all my application, and I used to get the context name and append it to my code as something like this:
<PARAM NAME="Src" VALUE="<%= contextPath %>/images/flashs/movie.swf">

but I found that th gateway doesn't change these to the https mode at all, so the swf file never appears, so I want to get the full absolute path from serverside in a variable and make it
<PARAM NAME="Src" VALUE="<%= absolutePath %>/images/flashs/movie.swf">

Is there any API that does this so I can use it or any other suggestion?

This problem also persists with IBM access manager.

Thanks for yr help


Ashraf Fouad
SCJP 1.2, SCBCD 5
 
wood burning stoves
 
subject: get the absolute url from JSP or servlet
 
Similar Threads
Change in servlet-class & servlet-name in web.xml not reflected? Why?
Communicate with the server without a browser.
getContextPath() in HttpServletRequest
ServletMapping
URL rewriting with cocoon and xslt