开发者

Try to use Base64Utils - but GWT compiler fails

I try to use the com.google.gwt.user.server.Base64Utils to encode my image on the server side, but the compiler giving me this info (later causing an error):

*"[INFO] [ERROR] Errors in 'jar:file:/C:/.../....rpc-1.12-SNAPSHOT.jar!/...////PictureFileDTO.java' 
[ERROR] Line 46: No source code is available for type com.google.gwt.user.server.Base64Utils; did 开发者_运维知识库you forget to inherit a required module?"*

Using GWT 2.1.0 and Maven in Eclipse.

What am I missing here? Any ideas?


The gwt-user.jar is the library you develop against, regardless whether you develop client-side or server-side code. It contains everything, UI widgets, utility-classes for the client-side, as well as utility-classes for the server-side.

The gwt-servlet.jar is used at runtime. I'm not talking about development mode, but about running your web application on some web server (Apache, IIS...). The gwt-servlet.jar contains the classes that are needed by the web server to run server-side GWT stuff.

So yes, the Base64Utils class is in both JAR files. Nevertheless it is not available for client-side development.

If you need something that work on both sides, check this out:

http://www.source-code.biz/base64coder/java/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜