SafeHtml on the server/vm

68 views
Skip to first unread message

Colin Alworth

unread,
Jun 9, 2014, 6:33:40 PM6/9/14
to google-web-tool...@googlegroups.com
Currently SafeHtml &co live in gwt-user, though they are for the most part listed in a shared package, implying that a server can use them. However, gwt-user.jar also includes javax packages as well as hibernate, w3c, etc, so can't reasonably be imported to a server which already uses any of those packages (i.e. any servlet container). Is this an oversight in the publicly packaged GWT and is SafeHtml used by teams that package differently, or instead is this package not actually intended for server use, but instead just compile-time tasks where gwt-user is on the classpath like compiling or linking?

I'm doing some work on a non-servlet server which hasn't so far seen concrete issues with gwt-user.jar, and having SafeHtml seemed to be an easy way to get server generated HTML from code that is shared with the client. This use case *appears* to be implied from the package name, but presently isn't possible for the majority of GWT backends.

Ideas on why it is the way it is? Thoughts on how to make it available to the server (without giving it yet another jar a la requestfactory-server)? Interest in a contributed SafeHtmlTemplates implementation for JVM?

Thanks,
Colin

John A. Tamplin

unread,
Jun 9, 2014, 7:22:42 PM6/9/14
to Google Web Toolkit Contributors
Yes, SafeHtml is intended to be usable on the server.  There have been various discussions about splitting up gwt-user into parts for client-only, shared (and perhaps server-only), but that wasn't ever done.

Mostly, putting gwt-user last on the classpath on your server won't cause any issues, though at least one JVM used to be unhappy with native methods without corresponding binaries.

--
John A. Tamplin

Colin Alworth

unread,
Jun 9, 2014, 7:58:26 PM6/9/14
to google-web-tool...@googlegroups.com
Like I said, its not a concern for me (no servlet, no hibernate, no flute), but for those who want to stick gwt-user.jar in a WEB-INF/lib/, it would be nice to not have to renamed it "zwt-user.jar".

My knee-jerk reaction is to put it in gwt-servlet (since other relatively new classes like AutoBeanFactorySource also made it in there) - does that seem like a reasonable step?


--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAM5k6X8CHkCjQK1CvGRxwS9H279BKpnZ%3DjeYwuVgqZtj6JJD3w%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
218.248.6165
nilo...@gmail.com

Ray Cromwell

unread,
Jun 9, 2014, 8:06:23 PM6/9/14
to google-web-toolkit-contributors
Most shared stuff should perhaps be copied into gwt-servlet.jar.  But that's a temporary solution, really, we need smaller build targets for each of those dependencies. You should be able to just depend on gwt-safehtml-shared.jar

-Ray



Thomas Broyer

unread,
Jun 10, 2014, 4:43:48 AM6/10/14
to google-web-tool...@googlegroups.com
SafeHtml is in gwt-servlet. In 2.5.1 and earlier it was missing the streamhtmlparser classes, but we've fixed this in 2.6 so it should work now (I must say I haven't tried it though)

Colin Alworth

unread,
Jun 10, 2014, 12:56:10 PM6/10/14
to google-web-tool...@googlegroups.com
Ah ha! I dropped the ball in my testing, by supporting GWT 2.4+ instead of limiting to something more recent and manageable like 2.5.1+. Confirmed, SafeHtml etc is in gwt-servlet in recent GWT.

Thanks for the sanity check Thomas.
Reply all
Reply to author
Forward
0 new messages