just in ram

A list of stuff I should remember but never do

SAP Portal HTTP or HTTPS?

without comments

Want to tell if your iView is running over HTTP or HTTPS?

Try this:

WARNING: Untested code ahead!

HttpServletRequest servletRequest = componentRequest.getServletRequest();
String requestURL = servletRequest.getRequestURL().toString();
String protocol = requestURL.substring(0, requestURL.indexOf(":"));

if(protocol.equals(”http”))
{
// do HTTP stuff
}
else
{
// do HTTPS stuff
}

Written by Justin Ramel

February 22nd, 2006 at 11:36 am

Leave a Reply