I have this link on my page (page1):
<a href="@{Controller.action1().secure()}">Link1</a>
that takes me to a page (page2) over https. How to make a link on page2 that takes me back from https to http? I thought @@ notation would do the trick:
<a href="@@{Controller.action2()}">Link2</a>
but it doesn’t, action2 also gets called via https.
Play doesn’t have a method that would be opposite to secure(), but you can implement it yourself with custom JavaExtension:
Custom extension methods should return
String, and the parameter will hold the enhanced object, as the documentation suggests. The code is almost identical to the secure method’s code.With this method you can now use: