Quick idea, sorry if I don't put little/any code (it may not even work,
trying won't hurt much hopefully...):
Have your whole app below a given URI 'base' path, say: yourapp/
Make the first resource in the routing chain a Filter that will take the
Reference from the Request and a) change its protocol from http to https;
b) prepend "yourapp/" on the path; c) redirect to the updated Reference,
then set it up with something like this:
Router grouter = YourApp.getGuardedRouter();
grouter.attach("/", YourHttpsRedirector.class);
grouter.attach("/yourapp/route1/", YourAppCollectionResourceHandler1.class);
grouter.attach("/yourapp/route1/{element}",
YourAppElementResourceHandler1.class);
...
...
grouter.attach("/yourapp/routeN/", YourAppCollectionResourceHandlerN.class);
Hope this helps.
On Tue, Sep 9, 2014 at 12:45 PM, hshorter <[email protected]> wrote:
> Is there a way to redirect a browser from HTTP to HTTPS?
>
> For example, I enter "localhost:1234/MyApplication" into a browser and I
> would like it to redirect to "https://localhost:1234/MyApplication".
>
> Thanks.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3088137
>
--
Fabián Mandelbaum
IS Engineer
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3088140