锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频免费播放,亚洲变态另类一区二区三区,亚洲美女精品视频http://m.tkk7.com/17learning/category/53415.html鎴戠殑鍗氬錛歨ttp://blog.sina.com.cn/17learningzh-cnSun, 19 May 2013 20:21:09 GMTSun, 19 May 2013 20:21:09 GMT60Jfinal璇誨彇Freemarker鍚巖enderHtml 婧愮爜http://m.tkk7.com/17learning/archive/2013/05/19/399469.html綆″厛椋?/dc:creator>綆″厛椋?/author>Sun, 19 May 2013 06:16:00 GMThttp://m.tkk7.com/17learning/archive/2013/05/19/399469.htmlhttp://m.tkk7.com/17learning/comments/399469.htmlhttp://m.tkk7.com/17learning/archive/2013/05/19/399469.html#Feedback0http://m.tkk7.com/17learning/comments/commentRss/399469.htmlhttp://m.tkk7.com/17learning/services/trackbacks/399469.html1銆丆ontroller錛?br />               Map<String, Object> rootMap = new HashMap<String, Object>();
ootMap.put("list",getMusicPublisList(page.getList()));
String templateName="appweb/music/index.ftl";
  Render appRender=new AppFreeMarkerRender(rootMap,templateName);
  this.render(appRender);
2銆丄ppFreeMarkerRender錛堝湪FreeMarkerRender涓婁慨鏀癸級錛?br />
package com.microcorecn.common.utils;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import javax.servlet.ServletContext;
import com.jfinal.render.Render;
import com.jfinal.render.RenderException;
import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
/**
 * FreeMarkerRender.
 */
public class AppFreeMarkerRender extends Render {
private static final long serialVersionUID = -7649769283048920381L;
private transient static final String encoding = getEncoding();
private transient static final String contentType = "text/html; charset=" + encoding;
private String templateName;
private Map<String, Object>  rootMap;
public AppFreeMarkerRender(Map<String, Object> rootMap, String templateName) {
  this.templateName=templateName;
  this.rootMap=rootMap;
}
    
@SuppressWarnings({"unchecked", "rawtypes"})
public void render() {
response.setContentType(contentType);
        Enumeration<String> attrs = request.getAttributeNames();
Map root = new HashMap();
while (attrs.hasMoreElements()) {
String attrName = attrs.nextElement();
root.put(attrName, request.getAttribute(attrName));
}
         root.putAll(rootMap);
         
PrintWriter writer = null;
        try {
Template template = FreemarkerUtil.getAppConfiguration().getTemplate(this.templateName);
writer = response.getWriter();  //涓杈硅姹傦紝涓杈箁ender
template.process(root, writer); // Merge the data-model and the template
} catch (Exception e) {
throw new RenderException(e);
}
finally {
if (writer != null)
writer.close();
}
}
}
3銆丗reemarkerUtil 錛?br />package com.microcorecn.common.utils;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jfinal.kit.PathKit;
import com.jfinal.render.FreeMarkerRender;
import freemarker.cache.FileTemplateLoader;
import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.Template;
/**
 * freemarker鐢熸垚html鐨勫伐鍏風被
 * 
 * @author Administrator
 * 
 */
public class FreemarkerUtil {
//淇濆瓨鎵鏈夊弬鏁?js璺緞,cs璺緞絳?/div>
private static Map<String, Object> releaseParams = new HashMap<String, Object>();
static{
//releaseParams.put("csspath", "");
}
//閰嶇疆
private static Configuration config = null;
private static Configuration appConfig = null;
/**
* appConfig閰嶇疆鎵鏈夊弬鏁?/div>
* 閲嶅啓freemarker涓殑  reader鏂規硶錛岃鍙栬閰嶇疆鏂囦歡
* @return
*/
public static Configuration getAppConfiguration()
{
if(appConfig == null)
{
//浠巉reemarker涓幏鍙栨墍鏈夐厤緗?/div>
appConfig = (Configuration)FreeMarkerRender.getConfiguration().clone();
try {
//璁劇疆妯℃澘璺緞
/* config.setDirectoryForTemplateLoading(new File(PathKit.getWebRootPath()));
config.setObjectWrapper(new DefaultObjectWrapper());*/
appConfig.setDirectoryForTemplateLoading(new File(PathKit.getWebRootPath()+"/WEB-INF/views/"));
appConfig.setObjectWrapper(new DefaultObjectWrapper());   
} catch (IOException e) {
// TODO log
}
}
return appConfig;
}


]]>Jfinal涓嶈兘浣跨敤鍒悕錛宲6spy鐩戞帶鏁版嵁搴撴棩蹇?/title><link>http://m.tkk7.com/17learning/archive/2013/04/02/397307.html</link><dc:creator>綆″厛椋?/dc:creator><author>綆″厛椋?/author><pubDate>Tue, 02 Apr 2013 10:40:00 GMT</pubDate><guid>http://m.tkk7.com/17learning/archive/2013/04/02/397307.html</guid><wfw:comment>http://m.tkk7.com/17learning/comments/397307.html</wfw:comment><comments>http://m.tkk7.com/17learning/archive/2013/04/02/397307.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/17learning/comments/commentRss/397307.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/17learning/services/trackbacks/397307.html</trackback:ping><description><![CDATA[<div>闂鍘熷洜錛欽Final涓牴鎹儲寮曟煡璇㈠垪鍚嶃?br />1銆侀噸鏂版柊寤篋B綾伙細<br />package com.microcorecn.jfinalex;</div><div></div><div>import java.sql.Connection;</div><div>import java.sql.PreparedStatement;</div><div>import java.sql.ResultSet;</div><div>import java.sql.SQLException;</div><div>import java.util.ArrayList;</div><div>import java.util.List;</div><div></div><div>import com.jfinal.plugin.activerecord.ActiveRecordException;</div><div>import com.jfinal.plugin.activerecord.DbKit;</div><div></div><div>public class DbEx {</div><div><span style="white-space:pre"> </span>static <T> List<T> query(Connection conn, String sql, Object... paras) throws SQLException {</div><div><span style="white-space:pre"> </span>List result = new ArrayList();</div><div><span style="white-space:pre"> </span>PreparedStatement pst = conn.prepareStatement(sql);</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>for (int i=0; i<paras.length; i++) {</div><div><span style="white-space:pre"> </span>pst.setObject(i + 1, paras[i]);</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>// for (int i=0; i<paras.length; i++) {</div><div><span style="white-space:pre"> </span>// pst.setObject(i + 1, paras[i]);</div><div><span style="white-space:pre"> </span>// }</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>ResultSet rs = pst.executeQuery();</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>int colAmount = rs.getMetaData().getColumnCount();</div><div><span style="white-space:pre"> </span>String[] cols = new String[colAmount];</div><div><span style="white-space:pre"> </span>for(int i = 0; i < colAmount; ++i)</div><div><span style="white-space:pre"> </span>{</div><div><span style="white-space:pre"> </span>cols[i] = rs.getMetaData().getColumnLabel(i + 1);</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>if (colAmount > 1) {</div><div><span style="white-space:pre"> </span>while (rs.next()) {</div><div><span style="white-space:pre"> </span>Object[] temp = new Object[colAmount];</div><div><span style="white-space:pre"> </span>for (int i=0; i<colAmount; i++) {</div><div><span style="white-space:pre"> </span>temp[i] = rs.getObject(cols[i]);</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>result.add(temp);</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>else if(colAmount == 1) {</div><div><span style="white-space:pre"> </span>while (rs.next()) {</div><div><span style="white-space:pre"> </span>result.add(rs.getObject(cols[0]));</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>if (rs != null) {try {rs.close();} catch (SQLException e) {}}</div><div><span style="white-space:pre"> </span>if (pst != null) {try {pst.close();} catch (SQLException e) {}}</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>return result;</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>public static <T> List<T> query(String sql, Object... paras) {</div><div><span style="white-space:pre"> </span>Connection conn = null;</div><div><span style="white-space:pre"> </span>try {</div><div><span style="white-space:pre"> </span>conn = DbKit.getConnection();</div><div><span style="white-space:pre"> </span>return query(conn, sql, paras);</div><div><span style="white-space:pre"> </span>} catch (Exception e) {</div><div><span style="white-space:pre"> </span>throw new ActiveRecordException(e);</div><div><span style="white-space:pre"> </span>} finally {</div><div><span style="white-space:pre"> </span>DbKit.close(conn);</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>}</div><div>}</div><div>2銆佹煡璇俊鎭細<br /><div>List<Object[]>  newAlbum=DbEx.query(sb.toString(), singerItem.get("id"));</div><div><span style="white-space:pre"> </span>if (newAlbum!= null) {</div><div><span style="white-space:pre"> </span>for(Object[] obj:newAlbum){</div><div><span style="white-space:pre"> </span> item.setBfpSingerId(obj[0]==null?"":obj[1].toString());</div><div><span style="white-space:pre"> </span> item.setSingerName(obj[1]==null?"":obj[1].toString());</div><div><span style="white-space:pre"> </span> item.setImgUrl(obj[2]==null?"":obj[2].toString());</div><div><span style="white-space:pre"> </span> item.setBfpAlbumId(obj[3]==null?"":obj[3].toString());</div><div><span style="white-space:pre"> </span> item.setNewAlbumName(obj[4]==null?"":obj[4].toString());</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>} </div><br /></div><img src ="http://m.tkk7.com/17learning/aggbug/397307.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/17learning/" target="_blank">綆″厛椋?/a> 2013-04-02 18:40 <a href="http://m.tkk7.com/17learning/archive/2013/04/02/397307.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>JFinal鑾峰彇瀛楃涓瞛son鎴栬呰幏鍙杔ist榪斿洖Json瀵硅薄銆?/title><link>http://m.tkk7.com/17learning/archive/2013/03/15/396464.html</link><dc:creator>綆″厛椋?/dc:creator><author>綆″厛椋?/author><pubDate>Fri, 15 Mar 2013 01:05:00 GMT</pubDate><guid>http://m.tkk7.com/17learning/archive/2013/03/15/396464.html</guid><wfw:comment>http://m.tkk7.com/17learning/comments/396464.html</wfw:comment><comments>http://m.tkk7.com/17learning/archive/2013/03/15/396464.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/17learning/comments/commentRss/396464.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/17learning/services/trackbacks/396464.html</trackback:ping><description><![CDATA[<div>Object data=getObject();<br />if(data instanceof String) {</div><div><span style="white-space: pre;">  </span> this.renderJson((String)data);</div><div>  }else {</div><div><span style="white-space: pre;">  </span>this.renderJson(data);</div><div>}</div><img src ="http://m.tkk7.com/17learning/aggbug/396464.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/17learning/" target="_blank">綆″厛椋?/a> 2013-03-15 09:05 <a href="http://m.tkk7.com/17learning/archive/2013/03/15/396464.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://sxjttxkywl.com" target="_blank">国产av无码专区亚洲av桃花庵</a>| <a href="http://w7768.com" target="_blank">亚洲综合色区中文字幕</a>| <a href="http://meinvtaotu.com" target="_blank">日韩免费电影网站</a>| <a href="http://770144.com" target="_blank">亚洲AV成人无码天堂</a>| <a href="http://djyvp32.com" target="_blank">亚洲国产精品成人网址天堂</a>| <a href="http://173ba.com" target="_blank">无码av免费一区二区三区试看</a>| <a href="http://bovch.com" target="_blank">亚洲欧洲日韩极速播放</a>| <a href="http://binz132.com" target="_blank">亚洲AV中文无码乱人伦在线视色</a>| <a href="http://xixidhw.com" target="_blank">国产午夜精品免费一区二区三区</a>| <a href="http://1000hu.com" target="_blank">亚洲fuli在线观看</a>| <a href="http://4438xx21.com" target="_blank">亚洲精品一级无码鲁丝片</a>| <a href="http://amjt9.com" target="_blank">2021国内精品久久久久精免费</a>| <a href="http://ksyy888.com" target="_blank">中文字幕在线观看亚洲日韩</a>| <a href="http://wwwdd312.com" target="_blank">国产精品亚洲不卡一区二区三区</a>| <a href="http://aijiu868.com" target="_blank">最近中文字幕免费完整</a>| <a href="http://shmtweld.com" target="_blank">青娱乐在线视频免费观看</a>| <a href="http://xsjxp.com" target="_blank">亚洲欧洲日韩国产综合在线二区</a>| <a href="http://516kd.com" target="_blank">日韩精品视频免费在线观看</a>| <a href="http://www-33758.com" target="_blank">一个人免费视频在线观看www </a>| <a href="http://wwwpaogou123.com" target="_blank">亚洲国产成人久久综合野外</a>| <a href="http://yisousou.com" target="_blank">久久久久国产精品免费网站</a>| <a href="http://meinvtaotu.com" target="_blank">WWW国产亚洲精品久久麻豆</a>| <a href="http://mcjc1.com" target="_blank">亚洲美女aⅴ久久久91</a>| <a href="http://t66ycom.com" target="_blank">久久精品国产精品亚洲人人</a>| <a href="http://k67m.com" target="_blank">四虎影视大全免费入口</a>| <a href="http://szgyk.com" target="_blank">免费无码又爽又刺激高潮视频 </a>| <a href="http://1444000.com" target="_blank">免费人成在线观看网站</a>| <a href="http://nnlxl.com" target="_blank">亚洲成a∧人片在线观看无码</a>| <a href="http://srvz83.com" target="_blank">亚洲国产精品久久久久久</a>| <a href="http://65123456.com" target="_blank">免费观看亚洲人成网站</a>| <a href="http://heifengmi.com" target="_blank">91福利免费视频</a>| <a href="http://zc-zk.com" target="_blank">久草免费福利在线</a>| <a href="http://zkqzdq.com" target="_blank">亚洲AV无码专区在线观看成人</a>| <a href="http://51caox.com" target="_blank">亚洲视频精品在线观看</a>| <a href="http://guanxianedu.com" target="_blank">亚洲午夜精品第一区二区8050</a>| <a href="http://91packing.com" target="_blank">人妻视频一区二区三区免费</a>| <a href="http://zygwkqf.com" target="_blank">暖暖免费日本在线中文</a>| <a href="http://yiuuu.com" target="_blank">国产99久久久久久免费看</a>| <a href="http://ddtase.com" target="_blank">亚洲精品国产suv一区88</a>| <a href="http://33eaa.com" target="_blank">亚洲高清无在码在线电影不卡</a>| <a href="http://51cga.com" target="_blank">亚洲熟妇丰满多毛XXXX</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>