<commit_before>package com.firefly.mvc.web.view;

import java.io.IOException;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.firefly.mvc.web.View;
import com.firefly.mvc.web.servlet.SystemHtmlPage;
import com.firefly.template.Model;
import com.firefly.template.TemplateFactory;
import com.firefly.utils.log.Log;
import com.firefly.utils.log.LogFactory;

public class TemplateView implements View {
	
	private static Log log = LogFactory.getInstance().getLog("firefly-system");
	protected static TemplateFactory templateFactory;
	protected static boolean init = false;
	protected static String charset = "UTF-8";
	
	protected String page;
	
	public static void init(String viewPath, String encoding) {
		if (!init) {
			log.info("template path {}", viewPath);
			com.firefly.template.Config config = new com.firefly.template.Config();
			config.setViewPath(viewPath);
			config.setCharset(encoding);
			charset = encoding;
			templateFactory = new TemplateFactory(config).init();
			init = true;
		}
	}
	
	public static TemplateFactory getTemplateFactory() {
		return templateFactory;
	}
	
	public static String getCharset() {
		return charset;
	}
	
	public TemplateView(String page) {<commit_msg>增加get方法获取模版页面<commit_after>package com.firefly.mvc.web.view;

import java.io.IOException;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.firefly.mvc.web.View;
import com.firefly.mvc.web.servlet.SystemHtmlPage;
import com.firefly.template.Model;
import com.firefly.template.TemplateFactory;
import com.firefly.utils.log.Log;
import com.firefly.utils.log.LogFactory;

public class TemplateView implements View {
	
	private static Log log = LogFactory.getInstance().getLog("firefly-system");
	protected static TemplateFactory templateFactory;
	protected static boolean init = false;
	protected static String charset = "UTF-8";
	
	protected String page;
	
	public static void init(String viewPath, String encoding) {
		if (!init) {
			log.info("template path {}", viewPath);
			com.firefly.template.Config config = new com.firefly.template.Config();
			config.setViewPath(viewPath);
			config.setCharset(encoding);
			charset = encoding;
			templateFactory = new TemplateFactory(config).init();
			init = true;
		}
	}
	
	public static TemplateFactory getTemplateFactory() {
		return templateFactory;
	}
	
	public static String getCharset() {
		return charset;
	}
	
	public String getPage() {
		return page;
	}

	public TemplateView(String page) {
{'fraction_non_alphanumeric': 0.10187185025197984, 'fraction_numerical': 0.0007199424046076314, 'mean_word_length': 5.080962800875273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3955681', 'n_tokens_mistral': 862, 'n_tokens_neox': 803, 'n_words': 191}