Hibernate模糊查询后台打印乱码

简介:

Hibernate 模糊查询中文乱码:项目中使用的各种编码都是UTF-8 ,JSP、Myeclipse、xml、属性配置文件,等。后台输出Hibernate语句如下:

 

 
  1. Hibernate: select orderinstr0_.id as id3_, orderinstr0_.userId1 as userId2_3_, 
  2. orderinstr0_.instrumentName as instrume3_3_, orderinstr0_.instrumentDescription as instrume4_3_, orderinstr0_.userId2 as userId5_3_, orderinstr0_.specification as specific6_3_, 
  3. orderinstr0_.instrumentAddr as instrume7_3_, orderinstr0_.manufacturer as manufact8_3_, orderinstr0_.status as status3_, 
  4. orderinstr0_.instrumentPic as instrum10_3_, orderinstr0_.reservationInformation as reserva11_3_, 
  5. orderinstr0_.SchInPrice as SchInPrice3_, orderinstr0_.SchOutnPrice as SchOutn13_3_, orderinstr0_.price as price3_, 
  6. orderinstr0_.buyTime as buyTime3_, orderinstr0_.enableSTime as enableS16_3_, 
  7. orderinstr0_.enableETime as enableE17_3_, orderinstr0_.enableTime as enableTime3_, 
  8. orderinstr0_.serviceFor as serviceFor3_ from orderSys.dbo.order_instrument orderinstr0_ where orderinstr0_.instrumentName like '%??????%' <!--此处获取的是乱码-->

查找了半天,后来仔细一看,发现没有写method方法!如果没有写method,那么form默认的值就是 method="get".
 

 
  1. <form action="/OrderSys/instrument/morelikelist.action" 
  2.                             theme="simple" method="get"><!-- method不写乱码 \改成get也是乱码,默认就是get--> 
  3.                         <input id="searchContent" name="d" type="text" 
  4.                                 class="input_border" value="输入名称或型号..." size="25" 
  5.                                 onfocus="this.value=''" /> 
  6.                         <select id="leixing" name="s" class="input_border" 
  7.                                 style="height: 20px; padding-top: 2px;"> 
  8.                         <option value="instrumentName"> 
  9.                             仪器名称  
  10.                                 </option> 
  11.                         <option value="specification"> 
  12.                             仪器型号                            
  13. </option>                       </select>                         
  14.   <input style="cursor: pointer;" name="" type="button" id="tijiao" 
  15.                                 value="" onclick="this.blur();submit();" /> 
  16.                         </form> 

关于get 和 post 的区别:请google.





 本文转自 w156445045 51CTO博客,原文链接: 本文转自 w156445045 51CTO博客,原文链接:,如需转载请自行联系原作者


,如需转载请自行联系原作者


相关文章
|
5月前
|
数据采集 数据处理 数据库
处理数据格式异常,例如无法完整显示数据、数据打开格式有误或者乱码等情况
处理数据格式异常,例如无法完整显示数据、数据打开格式有误或者乱码等情况
69 1
|
7月前
|
Java 数据库 Spring
【异常解决】解决mybatis-plus分页查询默认最多查询500条记录的问题,真是个大坑啊
【异常解决】解决mybatis-plus分页查询默认最多查询500条记录的问题,真是个大坑啊
148 0
|
10月前
fastadmin使用phpexcel导入日期打印出来却是数字(45108)----已解决
fastadmin使用phpexcel导入日期打印出来却是数字(45108)----已解决
75 0
|
10月前
|
关系型数据库 PostgreSQL
mybatisplus表字段是中文时启动项目报错(字符串访问越界)
报错信息: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
|
Java 数据库连接 mybatis
Mybatis的CRUD操作【包含查询记录总条数、模糊查找】(完整代码演示)
Mybatis的CRUD操作【包含查询记录总条数、模糊查找】(完整代码演示)
Mybatis的CRUD操作【包含查询记录总条数、模糊查找】(完整代码演示)
|
SQL Java 数据库连接
MyBatis 动态 SQL trim 的应用,可以添加或删除前缀或后缀
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/80986793 MyBatis 动态 SQL trim 的应用,可以添加或删除前缀或后缀。
1200 0
|
关系型数据库 MySQL 数据库
|
Java 数据库 应用服务中间件
JSP显示页面和数据库乱码
页面 和 数据库编码都是UTF-8,但就是奇怪。 指定Tomcat的编码为UTF-8 就行了  
1150 0