Yogi
Yogi

Reputation: 191

https turns to http when redirecting from one jsp page to other

My application runs in SSL now, in one of my JSP pages I have used response.sendRedirect("xyz.jsp");, so now when redirect occurs HTTPS is converted to HTTP. How should I fix this?

Upvotes: 2

Views: 2942

Answers (1)

Nir Alfasi
Nir Alfasi

Reputation: 53545

quick and dirty: add the following lines at the beginning of xyz.jsp

if(request.getScheme().equals("http")){  
            String redirect = "https://<your domain>/<path>/xyz.jsp"; 
            response.sendRedirect(redirect);  
}

Upvotes: 3

Related Questions