简体   繁体   English

GWT转义符

[英]GWT Escape Special Character

I am using GWT and java and hibernate on the server. 我正在使用GWT和Java并在服务器上休眠。 How can I escape characters on java on the server?? 如何在服务器上的Java上转义字符?

Are you looking for PreparedStatement? 您在寻找PreparedStatement吗?

See; 看到; How to capture/encode special character for SQL Server in java app? 如何在Java应用程序中为SQL Server捕获/编码特殊字符?

Where are you trying to escape special characters? 您想在哪里逃脱特殊字符? Static strings? 静态字符串? XML or JSON? XML还是JSON? Some sample code would make it a lot easier to answer this question. 一些示例代码将使回答这个问题变得容易得多。

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. 在服务器端,您处于标准Java环境中,因此您基本上可以使用任何您喜欢的内容,并最适合您的需求。 For XML for example there is "atlassian-xml-cleaner" 例如,对于XML,有“ 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. 在客户端上,它受到更多限制,但是在GWT2.1中,他们引入了SafeHtml ,这可能是您想要的。

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. 但是,请提供您的输入示例以及您希望从中获得的收益,因此更容易为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM