ÎҵĵÚÒ»¸öFreeMarkerÄ£°åÉú³Éjava´úÂëµÄÀý×Ó
µÚÒ»²½.н¨Ò»¸öÄ£°åÎļþÒÔ.ftl½áβ¡£
IDAO.ftl
package com.media.dao;
import java.util.List;
import com.media.bean.${model_name};
import com.media.exceptions.DAOException;
/**
* ${model_name_cn}½Ó¿Ú
*
* @author ${author}
* @link ${link}
*
* @version $Revision: 1.00 $ $Date: ${date?string("yyyy-MM-dd HH:mm:ss")}
*/
public interface I${model_name}DAO extends IGenericDAO<${model_name}>{
/**
* ¸ù¾Ý${model_name_cn}±àºÅ²éÕÒ${model_name_cn}ÐÅÏ¢
*
* @param ${instant}Id ${model_name_cn}񅧏
* @return ${model_name} ${model_name_cn}¶ÔÏó
* @throws DAOException
*/
public ${model_name} find${model_name}ById(Long ${instant}Id) throws DAOException;
/**
* ÅúÁ¿ÎïÀíɾ³ý${model_name_cn}(²»¿É»Ö¸´)
* @param ${instant}Ids ${model_name_cn}񅧏
* @throws DAOException
*/
public void delete${model_name_list}(Long[] ${instant}Ids) throws DAOException;
/**
* ÎïÀíɾ³ý${model_name_cn}(²»¿É»Ö¸´)
* @param ${instant}Id ${model_name_cn}񅧏
* @throws DAOException
*/
public void delete${model_name}(Long ${instant}Id) throws DAOException;
/**
* ±£´æ${model_name_cn}
* @param ${instant}
* @throws DAOException
*/
public void save${model_name}(${model_name} ${instant}) throws DAOException;
/**
* ¸üÐÂ${model_name_cn}
* @param ${instant}
* @throws DAOException
*/
public void update${model_name}(${model_name} ${instant}) throws DAOException;
/**
* ÀûÓÃhqlÓï¾ä²éѯ${model_name_cn}ÐÅÏ¢
* @param hsql
* @throws DAOException
*/
public List<${model_name}> find${model_name_list}(String hsql) throws DAOException;
/**
* ÀûÓÃhqlÓï¾ä²éѯ${model_name_cn}ÐÅÏ¢
* @param hsql
* @throws DAOException
*/
public List<${model_name}> find${model_name_list}(String hsql,Object[] params) throws DAOException;
}
µÚ¶þ²½.дһ¸öfreemakerµÄ¹¤¾ßÀàÓÃÓÚÉú³É´úÂë¡£
FreeMarkerUtil.java
×¢Ò⣺¹¤³Ì±ØÐëÒýÈëfreemaker.jar
package com.media.test;
impor
Ïà¹ØÎĵµ£º
1. Êý×éÓÐûÓÐlength()Õâ¸ö·½·¨? StringÓÐûÓÐlength()Õâ¸ö·½·¨£¿
´ð£ºÊý×éûÓÐlength()Õâ¸ö·½·¨£¬ÓÐlengthµÄÊôÐÔ¡£
StringÓÐlength()Õâ¸ö·½·¨¡£
2. String s = new String("xyz") ......
ÓÉÓÚ¹¤×÷ÐèÒª£¬ÒªÓÃ.netµÄ³ÌÐòµ÷ÓÃÒ»¸öjava±àдµÄweb service½Ó¿Ú£¬½Ó¿ÚµÄÒ»¸ö²ÎÊýÒªÇómd5·½Ê½¼ÓÃÜ¡£
.netÖеÄmd5¼ÓÃÜÊǺÜÈÝÒ׵ģ¬²ÉÓÃmsdnÖиø³öµÄ·½·¨:
// Hash an input string and return the hash as
// a 32 character hexadecimal string.
static string getMd5Hash(string input)
{
......
1¡£Ê¹ÓÃjava.util.PropertiesÀàµÄload()·½·¨
ʾÀý£º InputStream in = lnew BufferedInputStream(new FileInputStream(name));
Properties p = new Properties();
p.load(in);
2¡£Ê¹ÓÃjava.util.ResourceBundleÀàµÄgetBundle()·½·¨
ʾÀý£º ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault());
......
дÈë
public static void Writer(String value) {
try{
File file2 = new File("F:\\countDB.txt");
if(!file2.exists()){
  ......
1. Êý×éÓÐûÓÐlength()Õâ¸ö·½·¨? StringÓÐûÓÐlength()Õâ¸ö·½·¨£¿
´ð£ºÊý×éûÓÐlength()Õâ¸ö·½·¨£¬ÓÐlengthµÄÊôÐÔ¡£
StringÓÐlength()Õâ¸ö·½·¨¡£
2. String s = new String("xyz");´ ......