摘要: jsp; action; // 封装上传文件域的属性 private File image; // 封装上传文件类型的属性 private String imageContentType; // 封装上传文件名的属性 private String imageFileName; // // 接受依赖注入的属性 private String savePath;package com.file;import java.io.File;import java.io.FileInputStrea... 阅读全文
posted @ 2014-01-18 22:19 老汉! 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 工厂设计模式,创建分发各种bean。配置好它们之间的写作关系,参与bean的生命周期。BeanFactory factory = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));bean工厂只把bean的定义信息载进来,用到的时候才实例化。factory.getBean("mybean");就可得到一个bean。三种经常用到的实现:1.ClassPathXmlApplicationContext:从类路径中加载。2.FileSystemXmlApplicationCo 阅读全文
posted @ 2014-01-18 19:10 老汉! 阅读(310) 评论(0) 推荐(0) 编辑
摘要: public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException { // TODO Auto-generated method stub arg0.setCharacterEncoding("utf-8"); arg2.doFilter(arg0, arg1); arg1.setContentType("text/html... 阅读全文
posted @ 2014-01-18 19:02 老汉! 阅读(105) 评论(0) 推荐(0) 编辑
摘要: package com.test;import java.util.List;import org.hibernate.HibernateException;import org.hibernate.Query;import org.hibernate.Session;import org.hibernate.SessionFactory;import org.hibernate.Transaction;import org.hibernate.cfg.Configuration;import com.hibernate.Usertest.Usertest;public class Test 阅读全文
posted @ 2014-01-18 16:30 老汉! 阅读(94) 评论(0) 推荐(0) 编辑
摘要: dl.jsp; 用户登录 /yz.action" method="post"> 用户名 密码 action; private String name; private String password; private String tip; public String getTip() { return tip; } public void setTip(String tip) { this.tip = tip; } public String getName() { return name; } public void setName(String na. 阅读全文
posted @ 2014-01-18 12:44 老汉! 阅读(178) 评论(0) 推荐(0) 编辑
摘要: dl页面;用户登录 /yz!login.action" method="post"> 用户名 密码 hy页面; /yz!reglster.action">退出 View Code Action ;package com.st.action;import com.opensymphony.xwork2.ActionSupport;public class YzAction extends ActionSupport { public String login() throws Exception { System.out.println(&qu 阅读全文
posted @ 2014-01-18 12:35 老汉! 阅读(154) 评论(0) 推荐(0) 编辑