Monday, August 27, 2018

Re: hwo to get the server working?



On Monday, August 27, 2018 at 2:14:24 PM UTC+2, Andrew Somerville wrote:
No problem, Mike. 

Jetty isn't a Java EE container, it's simply a servlet container. That means it runs your app with a very minimal set of built-in functionality and none of the Java EE functionality. Essentially, everything your app does, it must do itself, including authentication, database access, etc.. Your app must include the libraries for whatever type of servlet it uses. Essentially no services are made available to your app by the container. This is great if you're not even using Java EE, and are instead using some other Java web framework. Lets say you're using Spring, for example...

This is wrong. Jetty can do authentication and database access on your behalf: see https://www.eclipse.org/jetty/documentation/9.4.x/jetty-javaee.html (and more specifically https://www.eclipse.org/jetty/documentation/9.4.x/configuring-security.html and https://www.eclipse.org/jetty/documentation/9.4.x/jndi-configuration.html#configuring-datasources)

The embedded Jetty server from the DevMode however is not really configurable, and is really only meant for webapps that don't use any of those features (i.e. that you can deploy in any servlet container without any specific configuration).

Fwiw, DevMode is discouraged nowadays for most production apps (because of those limitations, and the way it loads the webapp's classes and resources, which can easily break your apps in weird and hard-to-diagnose ways). It's great for small applications  though, like the StockWatcher example, where you want to jump right into coding with GWT (or small repro cases for bugs) and don't have many (or any) third-party dependencies. That way, you can learn GWT and Java servlet development "fast", and gradually acquire skills and switch to more "industrial" tools like Maven or Gradle as build tools, external servlet containers (either run from your IDE, or by your build tool), etc.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment