作为使用GWT的Base64我如何连接code /德code短字符串? [英] How do I encode/decode short strings as Base64 using GWT?

查看:116
本文介绍了作为使用GWT的Base64我如何连接code /德code短字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要带code很短的字符串作为GWT基地64日code服务器上的底座64串。任何人都有这个工具类或库?

I need to encode a short String as base 64 in GWT and decode the base 64 string on the server. Anyone have utility class or library for this?

推荐答案

您可以在客户端上的所有浏览器都使用本地JavaScript这除了IE以外≤9.在服务器上可以使用的one 的。

You can use native JavaScript for this on the client on all browsers except IE ≤ 9. On the server you can use one of the official classes.

的Java / GWT:

Java/GWT:

private static native String b64decode(String a) /*-{
  return window.atob(a);
}-*/;

恩code是 BTOA

这篇关于作为使用GWT的Base64我如何连接code /德code短字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆