
java
luozhiguo999
性格还好,爱好很多,生活态度乐观./
展开
-
通过freemarker生成一个超简单的动态表单例子
Configuration cfg = new Configuration(); Map map = new HashMap(); map.put("username", ""); map.put("password", ""); Template template = new Template("name",new StringReader("${username}${password}原创 2008-09-03 22:26:00 · 3529 阅读 · 0 评论 -
清除页面缓存
response.setHeader("Cache-Control","no-cache"); response.setHeader("Cache-Control","no-store"); response.setDateHeader("Expires",0); response.setHeader("Pragma","no-cache");原创 2008-09-24 14:10:00 · 691 阅读 · 0 评论 -
Spring 定时器
在Spring中有两种流行配置:Java的Timer类和OpenSymphony的Quartz。 1.Java Timer定时 首先继承java.util.TimerTask类实现run方法 import java.util.TimerTask; public class EmailReportTask extends TimerTask{ @Override public void run()原创 2008-10-20 17:50:00 · 543 阅读 · 0 评论 -
加载spring配置文件的常用三种方法
1方法(web.xml) contextConfigLocation /WEB-INF/applicationContext-*.xml org.springframework.web.context.ContextLoaderListener 2方法(web.xml) contextConfigLocation /WEB-INF/转载 2008-10-20 17:28:00 · 512 阅读 · 0 评论 -
通过apache 的 commons-email 包发送邮件
public static void main(String[] args) { //不要使用SimpleEmail,会出现乱码问题 HtmlEmail email = new HtmlEmail(); try{ //这里是发送服务器的名字:126的如下: email.setHostName("smtp.126.com"); //编码原创 2008-10-12 10:12:00 · 718 阅读 · 0 评论