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博客,原文链接:,如需转载请自行联系原作者


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


相关文章
|
8月前
|
SQL Java 数据库
jsp中使用Servlet查询SQLSERVER数据库中的表的信息,并且打印在屏幕上
该博客文章介绍了在JSP应用中使用Servlet查询SQL Server数据库的表信息,并通过JavaBean封装图书信息,将查询结果展示在Web页面上的方法。
jsp中使用Servlet查询SQLSERVER数据库中的表的信息,并且打印在屏幕上
|
8月前
|
前端开发
使用thymeleaf将查询的数据显示在前台。通过使用循环的形式
这篇文章介绍了如何使用Thymeleaf的`th:each`属性在前端页面上循环显示从后端传递过来的列表数据,并通过具体的HTML表格示例展示了如何展示书籍名称、作者、价格、出版社以及操作链接。
|
Java
springboot全局字符编码设置(解决乱码问题)
springboot全局字符编码设置(解决乱码问题)
1491 0
springboot全局字符编码设置(解决乱码问题)
|
Java 数据库连接 mybatis
Mybatis的CRUD操作【包含查询记录总条数、模糊查找】(完整代码演示)
Mybatis的CRUD操作【包含查询记录总条数、模糊查找】(完整代码演示)
Mybatis的CRUD操作【包含查询记录总条数、模糊查找】(完整代码演示)
使用phpexcel导出excel乱码问题解决方法
使用phpexcel导出excel乱码问题解决方法
335 0
使用phpexcel导出excel乱码问题解决方法
|
SQL Java 数据库连接
MyBatis 动态 SQL trim 的应用,可以添加或删除前缀或后缀
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/80986793 MyBatis 动态 SQL trim 的应用,可以添加或删除前缀或后缀。
1297 0
|
关系型数据库 MySQL 数据库