Hibernate 中 联合主键映射 组合关系映射 大对象映射(或者说文本大对象,二进制数据大对象)
摘要:Clob:文本大对象,最长4G Blob:二进制数据大对象,最长4G util: public class HibUtil { private static SessionFactory sessionFactory; static{ //获取配置信息 hibernate.cfg.xml Confi
阅读全文
struts2 模拟令牌机制防止表单重复提交
摘要:web.xml: <?xml version="1.0" encoding="UTF-8"?><web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLS
阅读全文
struts2 自带的 token防止表单重复提交拦截器
摘要:在struts2中,我们可以利用struts2自带的token拦截器轻松实现防止表单重复提交功能! 1. 在相应的action配置中增加: <interceptor-ref name="token"></interceptor-ref> <result name="invalid.token">/e
阅读全文
struts2 标签
摘要:web.xml: <?xml version="1.0" encoding="UTF-8"?><web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.or
阅读全文
struts2 上传文件
摘要:web.xml: <?xml version="1.0" encoding="UTF-8"?><web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.or
阅读全文
什么样的数据应该放入缓存
摘要:把数据放入缓存,有三个标准: 1.数据量不大 2.访问频率高 3.数据更改频率低
阅读全文
关于struts2输出excel表
摘要:web.xml: <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaL
阅读全文
关于异常的一点认识
摘要:在异常中最大的类是Throwable,分为二个子类:Exception,Error Exception:是程序可以处理的异常 Error:表示JVM错误,一般程序无法处理 Exception与RuntimeException的区别: 1.如果抛出的是Exception的类型,则必须使用try...c
阅读全文
spring 整合 hibernate xml配置
摘要:spring 整合 hibernate: hibernate :对数据库交互 spring: ioc aop 整合点: 1.sessionFactory对象不再由hibernate生成,交由spring生成,也就是说数据库连接信息 全局配置 映射文件的配置 由spring完成 2.ioc 管理dao
阅读全文
spring 整合 struts2 xml配置
摘要:整合之前要搞清楚struts2是什么; struts2:表现层框架 增删改查 作用域 页面跳转 异常处理 ajax 上传下载 excel 调用service spring :IOC/DI:bean容器 aop 整合点: 1.struts2的所有对象 交由spring来管理 意味着struts.xml
阅读全文
spring AOP 注解配置
摘要:applicationContext-resource.xml: <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://ww
阅读全文
spring ioc 注解配置
摘要:要注意spring 版本与jdk的兼容性 applicationContext-resource.xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XML
阅读全文