无居之所
ymgjava · 共 10 篇文章
Spring整合JPA
<context:component-scan base-package="com.test.shop"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> <context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice"/> </context:component-scan> <conte…
2015-11-03 15:36 · Spring · 评论(0)
Spring 2.5整合DWR 2.06
方法一:各种配置如下 <servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-…
DWR出现的A request has been denied as a potential CSRF attack解决办法
学习DWR的时候,用的是DWR2.0.6版本和火狐浏览器,在做官方的Hello world 的时候,按照文档,做的如下配置: <servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-map…
2011-07-08 14:02 · DWR · 评论(0)
Spring 2.5整合iBATIS 2.3并使用Spring的声明式事务管理
Spring 2.5整合iBATIS 2.3的核心配置文件beans.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:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schem…
Spring报cvc-complex-type.2.3错
将Spring与iBATIS整合,在运行Demo时报发下错误: cvc-complex-type.2.3: Element 'beans' cannot have character [children], because the type's content type is element-only. Google了好大时间,在网上发现也有不少人遇到这个问题,但是没有什么确切的原因描述与解决之道。 之后竟然绝境重生,我把applicationContext.xml中所有的注释语句(有中文)全部删除,运行程序,一切正常。 很是费解,难道是中文字符引起的问题,但中文是在 中写着啊。 更让人费解…
2011-07-07 00:43 · Spring · 评论(0)
iBATIS:java.sql.SQLException: ORA-00911: invalid character
项目用到iBATIS,编码期间,程序报错,抛出异常: java.sql.SQLException: ORA-00911: invalid character 检查好长时间,终于找到问题的所在,令人吐血的是,这又是一个分号引发的异常。 具体如下: <select id="showCompanyByProvince" parameterClass="java.util.HashMap"> SELECT i.ENT_NAME AS entName, …… WHERE i.PROV_CODE=#pCode#; </select> sql语句后面多了一个分号,删除即可。 吐血,晕菜!
2011-07-04 22:11 · iBATIS · 评论(3)
iBATIS,一个空格引发的NestedSQLException异常
近日,做项目用到了iBATIS,coding期间,遇到一个问题,iBATIS抛出NestedSQLException异常,捣腾好长时间,终于找到问题所在,令人吐血的是:这是“一个空格引发的异常”。 具体如下: <select id="getOrders" parameterClass="Product" resultClass="Product"> select * from orders …… …… *号与from之间的空格,原本是半角的,但是我不小心打成全角的了。 <select id="getOrders" parameterClass="Product" resultClass="P…
2011-07-03 22:32 · iBATIS · 评论(1)
dom4j格式化xml文件
dom4j格式xml并输出为 .xml文件 * public static void main(String[] args) { Document document = DocumentHelper.createDocument(); Element employees=document.addElement("employees"); Element employee=employees.addElement("employee"); Element name= employee.addElement("name"); name.setText("jim"); Element sex=em…
2011-07-03 21:03 · dom4j · 评论(0)
显示iBATIS执行的SQL语句的方法
使用log4j,修改log4j的配置文件,配置如下内容: # Set root logger level to DEBUG and its only appender to CONSOLE. log4j.rootLogger=WARN,CONSOLE # CONSOLE log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.Patte…
2011-07-02 00:03 · iBATIS · 评论(1)
JavaScript 编码转换
JavaScript中的编码方法: escape() 方法: MSDN JScript Reference中如是说: The escape method returns a string value (in Unicode format) that contains the contents of . All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexa…
2011-07-01 21:23 · JavaScript · 评论(0)