- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
现在我正在使用 spring 框架 + java + mysql(maria db)执行 select query(for searching) 时,没有问题但是当用韩语 (utf-8) 词搜索时那个词坏了
我认为查询没有问题,因为用英文或数字搜索时结果很好
这是我的调度程序 servlet
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing
infrastructure -->
<!-- Enables the Spring MVC @Controller programming model (annotation true) -->
<annotation-driven>
<message-converters>
<beans:bean
class="org.springframework.http.converter.StringHttpMessageConverter">
<beans:property name="supportedMediaTypes" value="text/html;charset=UTF-8" />
</beans:bean>
</message-converters>
</annotation-driven>
<!-- Handles HTTP GET requests for /resources/** by efficiently serving
up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />
<resources mapping="/uploadImg/**" location="/uploadImg/" />
<resources mapping="/UploadFile/**" location="/UploadFile/" />
<!-- Resolves views selected for rendering by @Controllers to .jsp resources
in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<beans:property name="order" value="1"></beans:property>
<beans:property name="viewClass">
<beans:value>org.springframework.web.servlet.view.tiles2.TilesView
</beans:value>
</beans:property>
</beans:bean>
<beans:bean
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<beans:property name="definitions">
<beans:list>
<beans:value>/WEB-INF/tiles/tiles-*.xml</beans:value>
</beans:list>
</beans:property>
</beans:bean>
<context:component-scan base-package="com.ex.biz" />
<interceptors>
<beans:bean class="com.ex.biz.intercepter.InterCepterCheck"/>
</interceptors>
</beans:beans>
这是mybatis-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:property-placeholder location="classpath:config/ex.properties" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${ex_driver}"></property>
<property name="url" value="${ex_url}"></property>
<property name="username" value="${ex_username}"></property>
<property name="password" value="${ex}"></property>
<property name="validationQuery" value="select 1"></property>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="typeAliasesPackage" value="com.ex.biz.dto"></property>
<property name="configLocation" value="classpath:config/mybatis.xml"></property>
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory"></constructor-arg>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
</beans>
我应该修改什么配置??如果我错过了概念,你能告诉我吗??我现在很困惑......
当我搜索“나나”时,执行了写为“ëë”的查询
谢谢你帮助我
最佳答案
我找到了答案首先,我确定我的数据库表设置为“utf-8”
我以 GET 方式发送数据所以 tomcat 服务器(在 server.xml 中)设置 URIEncoding
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>
URIEncoding="UTF-8"
然后我解决所有问题
如果你有像我一样的问题。您必须以 POST 方式发送数据。或者作为 GET 发送,然后将 uriEcoding 放入 server.xml
关于java - mysql查询韩语(外语)单词坏了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26075804/
有人可以为韩语、印尼语、泰语和越南语推荐一个开源的 POS 标记器吗? 我可以用它来标记我目前拥有的语料库数据。 (例如 the stanford-postagger ) 如果您是开发人员并且愿意分享
我正在尝试在同一个文件中写出英语、日语和韩语。 这是我的做法: new File("genned/test123.txt").write("안녕하세요 hello こんにち", "utf8") 生成的
许多日语字体都有标准 ASCII 拉丁字符的特殊固定宽度变体,其宽度是字体的汉字/假名字符标准固定宽度的一半。这样,您只需为每个日语字符使用 2 个拉丁字符即可垂直排列拉丁语和日语文本。这被称为“半角
问题是我们是否有一个段落同时包含韩语(韩语)字符和罗马字符。 CSS 中有没有办法让韩文字符使用某种字体,而罗马字符使用另一种字体? 例如,我想对韩文使用 Noto Sans KR,对罗马字符使用 H
我正在尝试验证用户输入(在 Python 中)并查看是否使用了正确的语言,在本例中为韩语。让我们用韩语单词表示电子邮件地址:이메일 주소 我可以像这样检查每个字符: import unicodedat
我正在用 C 语言制作一个网络服务器。我需要从 url 获取参数以进行计算。问题是人们可以在一个字段(名称)中键入 unicode 字符。然而,当我的服务器收到那个请求时,这些 unicode 字
此前ios最新版微信有边写边译功能,输入的对话可以自动翻译成英语、韩语、日语等多种语言,不少安卓用户羡慕不已!不过就在昨天微信安卓8.0.18内测版的推出新增了边写边译功能,安卓的小伙伴们也终于可以
我在Windows 10中使用了Sublime Text 3。 从上面的截图中可以看到,韩文/中文/日文字符在“转到任何内容”文本输入,侧边栏和选项卡标题中均被打断。 有谁知道如何解决这个问题?我认为
我尝试在 python 中读取一些以“euc-kr”编码的韩语文本文件,但出现了一些错误。在检查 encodings 模块一段时间后,我了解到该模块以看似非常奇怪的方式对韩语字符进行编码。我举个例子
我正在尝试对 Hangul(韩语字符)进行颜色编码。每个“ block ”都会创建一个韩语音节。 Hangul 被分解为 Jamo(类似于英语中的字母)。当您键入韩语中的 jamo/字母时,它们通常会
我需要在包含标题的 2.000.000 个数据库行中进行搜索,例如歌曲。我需要一个能够快速提供结果、适用于 iOS 平台并支持 unicode 字符集的解决方案。我正在考虑使用 sqlite 的 FT
当我尝试通过 CkFtp2.java 客户端使用日语/韩语/阿拉伯语用户名/密码登录 FTP 服务器时,失败并显示消息“530 请先使用 USER 和 PASS 登录”。当我使用英文用户名/密码时,一
我遇到了 JPasswordField 组件尝试使用亚洲复合字符的不一致行为的问题。 我的代码是: final JCheckBox visiblePassword = new JCheckBo
我正在开发一个 vue 项目,这是一个小错误的修复。但这让我很难受。 我制作了 v-text-field 仅输入数字,看起来效果很好。 我只想输入数字,因此我使用 keydown 事件来使用 Pre
我是一名优秀的程序员,十分优秀!