据悉dom4j在xml解析方面是性能最好的,hibernate等框架都使用它作为解析的工具
写了简单的dom4j的使用的demo,以备回忆,有些是dom4j的文挡里例子改编的
使用dom4j解析下面的xml文件
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="students.xsl"?>
<students>
<student sn="01">
<name>张三</name>
< ...
- 21:21
- 浏览 (350)
- 评论 (0)
spring aop 的权限的管理是通过对路径的控制来实现的
现在共有两个角色,经理和员工
经理的权限检查的代码
MgrAuthorityInterceptor.java
public class MgrAuthorityInterceptor implements MethodInterceptor
{
public Object invoke(MethodInvocation invocation) throws Throwable
{
HttpServletRequest request = null;
ActionMappin ...
- 22:32
- 浏览 (436)
- 评论 (2)
编写这个小应用时出现的问题,以及解决的办法
1.
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
java.lang.NullPointerException org.hibernate.tuple.AbstractEntityTuplizer.createProxy
原因:没有设置缓存的情况下,
只可使用getHibernateTemplate().get(user.class,id)的方法,而使用load()方法则只对缓存进行操作
...
- 12:20
- 浏览 (765)
- 评论 (0)
主要简单说明一下页面的分页
package com.hello.web;
import java.util.ArrayList;
import java.util.List;
import com.hello.model.User;
public class Page {
//设置当前页
private int currentPage=1;
//总页数
private int totalPages=0;
//每页的记录数
private int pageRecorders=5;
//总共的记录数
private int totalRows ...
- 11:52
- 浏览 (530)
- 评论 (0)
这个简单的应用是入门级别的 ,方便大家入门
1,类似与springside(http://www.springside.org.cn/)中的例子helloworld具有的功能,
2,没有了springside中的将网页中的表单输出xls中的功能,
3,将那个helloworld例子中的分页功能简单化了
4,增加了添加用户或修改用户时的,javaMail通知的功能,
5,还有原来的对数据的增删改查
tomcat6.0作为服务器,mysql作为数据库
包结构:
com.hello.model 存放应用的pojo类
com.hello.dao,com.hello.dao.impl 数据层,使用 ...
- 17:37
- 浏览 (633)
- 评论 (0)
使用spring Mail 发送带email的邮件,大大的减小了使用java email发送邮件的麻烦,spring提供了一个MimeMessageHelper的助手类来完成发送附件的功能 package mail;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.Cl ...
- 20:31
- 浏览 (398)
- 评论 (0)
需要的spring的jar包有:spring.jar,mail.jar,commons-logging.jar,activation.jar
package mail;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.m ...
- 17:22
- 浏览 (469)
- 评论 (0)
- 浏览: 6011 次
- 性别:

- 来自: 成都

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
spring aop实现权限控制, ...
具体怎么配置啊?
-- by gaoshang502 -
spring aop实现权限控制, ...
action中的经理的操作怎么配置啊?
-- by gaoshang502 -
我们已经老了,无所谓了( ...
血已被时间一次又一次的冲洗干净了, 而当年在我们心中那种无畏,敢言的精神是不是已 ...
-- by mongkw01






评论排行榜