ITeye博客

kidd

kidd · 共 27 篇文章

Javascript取当前日期的代码

SCRIPT LANGUAGE="JavaScript">

2009-02-20 13:52 · 评论(0)

MD5加密

public final static String MD5(String pwd) { String Digest = ""; try { MessageDigest currentAlgorithm = MessageDigest.getInstance("md5"); currentAlgorithm.reset(); byte mess = pwd.getBytes();// 获取要加密的byte数组 byte hash = currentAlgorithm.digest(mess);// 获取加密以后的byte数组 for (int i = 0; i < hash.length; …

2009-02-19 10:13 · 评论(0)

session.flush()[转载]

hibernate一个Session有一个Cache,cache屏蔽了应用程序直接去访问数据库,如果同一张table的同一row在先前已经被请求过,那么为何下次请求的时候还要去请求一次呢,把前面的cache住,再遇到这样的请求直接返回cache里边的即可。 cache里边的数据如果含有脏数据,需要跟数据库同步(也就是需要hibernate来发送update, delete, insert),调用session.flush()达到此目的。一般情况下,hibernate在一个tx.commit()的时候会自动调用session.flush();也可以应用程序手动调用session.flush()…

2009-02-18 14:50 · 评论(0)

常见邮箱的POP和SMTP

126邮箱: POP:POP.126.com SMTP:SMTP.126.com http://mail.126.com/help/client_04.htm 163邮箱: POP:pop.163.com SMTP:smtp.163.com http://mail.163.com/help/help_client_04.htm 新浪邮箱: POP:pop.sina.com.cn 或:pop3.sina.com.cn SMTP:smtp.sina.com.cn http://tech.sina.com.cn/sinahelp/2002-06-14/120714.shtml TOM邮箱: POP…

2009-02-18 10:59 · 评论(0)

struts2配置

web.xml代码:下 <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Struts Blank</display-name> <!--定义Struts2的FilterDispat…

2009-02-16 16:48 · 评论(0)

自定义标签

web.xml代码:下 function.tld代码:下 <taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"> 处理EL转换的自定义函数 1.0 my-function /my-function …

2009-02-16 16:23 · 评论(0)

自定义控件

web.xml代码:下 tag.tld代码:下 <taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0"> my tag my tag 1.0 my-tag /my-tag <!-- 使用说明: jsp…

2009-02-16 16:10 · 评论(0)

struts2防止重复提交

JSP代码:下 struts.xml代码:下 /updpwd.jsp /result.jsp /result.jsp /WEB-INF/jsp/firstpage.jsp

2009-02-16 15:52 · 评论(0)

Java发送Email

/** * 发送电子邮件 * * @param tto * 要发送的邮件地址 * @param ttitle * 邮件标题 * @param tcontent * 邮件内容 */ public final static boolean sendMail(String tto, String ttitle, String tcontent) { boolean flag = false; try { Properties props = new Properties();// 也可用Properties props = // System.getProperties(); props.put(…

2009-02-16 15:38 · 评论(0)

Struts2相关jar包

Struts2相关JAR包,有需要的朋友可以下载!

2009-02-13 11:48 · 评论(0)

控制页面后退

<%response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-store"); response.setDateHeader("Expires",-1);%> 把上面的代码加在JSP页面上就可以了. 当用户操作过程中点击后退时,就相当于重新访问了前一个JSP页面. (当然,这个并不算是一个很好的方法!仅供参考…… :wink: )

2009-02-13 11:45 · 评论(0)

Tomact启动问题

问题: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.信息: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has be…

2009-02-13 11:34 · 评论(0)