Spring Controller on HTTPS and HTTP Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Spring Controller on HTTPS and HTTP without wasting too much if your time.

The question is published on by Tutorial Guruji team.

Can I make a controller is available by http and https.

Example:

https://mysite.ru/cart – one controller one page

http://mysite.ru/cart – same controller same page

Answer

Controllers merely process a request and return the response. You may choose to use different controllers to process different URL patters but none of these are in anyway related to the protocol used.

Protocol use would depend how you deploy your server. If you support SSL i.e provide server with valid keystore certificate and password then you will be able to use https protocol in your URLs.

Controllers deal with requests depending on the URL patters that comes after the protocol.

For supporting https URLs you can refer to my blog post on –Supporting https URLs on your server.

We are here to answer your question about Spring Controller on HTTPS and HTTP - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji