开发中常见小问题(笔记)

来源:互联网 发布:淘宝上正品金丝楠木店 编辑:程序博客网 时间:2024/04/30 12:10

1.mybatis在xml文件中处理大于号小于号的方法:”<”号用 “&lt;” 代替;
或者用 <![CDATA[ when min(starttime)<='12:00' and max(endtime)<='12:00' ]]>

insert into question values('001','我是一条记录&nbsp;你也是一条记录');

执行语句时发现叫你输入 nbsp;的值,原因是因为 plsql把 &作为一个变量的开头,所以每次执行这条语句时会提醒你,解决方法:只要把 define 的属性设置为: off 就可以了(set define off);这样就可以插入象&nbsp;&lt;&gt; 这样的特殊字符了。

2.金额字段采用BigDecimal,数据中用number(12,6);

3.后台用hibernate的hql语句查询的对象集合(如:List)不能用遍历,可以用struts2的标签来遍历。
后台代码:

List<FdInInvoice> invoiceList = projectService.getInvoiceListByPrjCode(prjCode);//hibernate 查询Struts2Utils.getRequest().setAttribute("invoiceList", invoiceList);

前端代码:

<c:if test="${not empty invoiceList }"><c:set value="0" var="index" scope="page" /><s:iterator value="#request.invoiceList"  var="invoice">      <li>      <table width="100%">                      <tr>         <td width="90">${invoice.invoiceNo}</td>        </tr>    </table>  </li>                         <c:set value="${index+1 }" var="index" scope="page" /> </s:iterator></c:if>