cancel
Showing results for 
Search instead for 
Did you mean: 

Switch from HTTPS to HTTP

0 Kudos
63

Hello ALL,

Is it possible to allow a portal user to switch from https to http after logging on via https ?

Regards

Suneel Razdan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

It is possible...

You need to implement the code in the Masthead iView that is in the Default Framework Page.

Take the code from portal and make the changes and deploy it with some other name com.yourcompany.project.masthead.par and then create a iView based on the PAR and add it to the Default Framework Page...I suggest to make a copy of the Default Framework Page and then modify that...

Regards,

JP

Former Member
0 Kudos

Hi John,

What code do we have to implement?

I have to implement this.

Thanks

-Kurien

Former Member
0 Kudos

Hi,

Use the following code in HeaderIview.jsp of the masthead.

<%

HttpServletRequest servletRequest = componentRequest.getServletRequest();

String httpsPort = componentRequest.getComponentContext().getProfile().getProperty("httpsport");

String requestURL = servletRequest.getRequestURL().toString();

String requestURI = servletRequest.getRequestURI();

String protocol = requestURL.substring(0, requestURL.indexOf(":"));

int serverPort = servletRequest.getServerPort() ;

String serverName = servletRequest.getServerName();

%>

<html>

<%

if(protocol.equals("http"))

{

String newURL = "https://"serverName":"httpsPortrequestURI;

%>

<head>

<script>

location.replace("<%=newURL%>");

</script>

<%

}

%>

</head>

Hope that helps.

JP