Run gwt with https enabled?

2019-02-28 03:36发布

问题:

I'm currently running a GWT site with no security, but need to make the switch over to HTTPS.

The working non-secure version runs with these arguments:

-port 8888 -startupUrl ui/index.jsp com.example.EntryPoint

I have read that simply adding -server :ssl will cause the site to be served with HTTPS enabled:

-port 8888 -startupUrl ui/index.jsp -server :ssl com.example.EntryPoint

However, with this I simply get

[ERROR] Unable to load server class ''
[ERROR] java.lang.ClassNotFoundException: 
[ERROR]     at java.lang.Class.forName0(Native Method)
[ERROR]     at java.lang.Class.forName(Class.java:249)
[ERROR]     at com.google.gwt.dev.DevMode$ArgHandlerServer.setString(DevMode.java:108)
[ERROR]     at com.google.gwt.util.tools.ArgHandlerString.handle(ArgHandlerString.java:26)
[ERROR]     at com.google.gwt.util.tools.ToolBase.processArgs(ToolBase.java:225)
[ERROR]     at com.google.gwt.dev.ArgProcessorBase.processArgs(ArgProcessorBase.java:29)
[ERROR]     at com.google.gwt.dev.DevMode.main(DevMode.java:281)
[ERROR] Google Web Toolkit 2.1.0

I'm not sure if I'm doing something wrong or if that method doesn't work any more? Is anyone successfully running this command or gwt with SSL?

回答1:

Assuming you are trying to use the embedded jetty server, SSL support was added in r9628. You are using GWT 2.1, so either try to update to a more recent version (at least GWT 2.3), or use an external SSL-preconfigured server for your application (option -noserver).



标签: gwt ssl