GWT 转义特殊字符
我在服务器上使用 GWT 和 java 和 hibernate。如何在服务器上转义java上的字符?
I am using GWT and java and hibernate on the server. How can I escape characters on java on the server??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您在寻找PreparedStatement吗?
看;
如何捕获/编码特殊字符Java 应用程序中的 SQL Server?
Are you looking for PreparedStatement?
See;
How to capture/encode special character for SQL Server in java app?
您想在哪里转义特殊字符?静态字符串? XML 还是 JSON?一些示例代码将使回答这个问题变得容易得多。
Where are you trying to escape special characters? Static strings? XML or JSON? Some sample code would make it a lot easier to answer this question.
在服务器端,您处于标准 Java 环境中,因此您基本上可以使用您喜欢且最适合您需要的任何内容。例如,对于 XML,有“atlassian-xml-cleaner”
在客户端,它受到更多限制,但是在 GWT2.1 中,他们引入了 SafeHtml 这可能就是您想要的。
但是,请提供您的输入示例以及您希望在其中转义的内容,这样可以更轻松地帮助您。
On the server side you are in a standard Java environment, so you can basically use whatever you like and fits best to your need. For XML for example there is "atlassian-xml-cleaner"
On the client it is much more restricted, however with GWT2.1 they introduced SafeHtml which could be what your looking for.
However, provide an example of your input and what you would like to have escaped in that, so its much easier to help you out.