简体   繁体   中英

GWT Escape Special Character

I am using GWT and java and hibernate on the server. How can I escape characters on java on the server??

Are you looking for PreparedStatement?

See; How to capture/encode special character for SQL Server in java app?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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