<%-- 
    Document   : a
    Created on : 2014-4-26, 18:59:09
    Author     : root
--%>


<%@page import="miin.core.docIo.MiinWebDocIoUtil"%>
<%@page import="java.io.File"%>
<%@page import="miincms.entryDomain.service.CmsArticleEntryService"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>文章 加载测试</title>
    </head>
    <body>
        
        <h1>文章 加载测试</h1>
        
     <%
     
     
           miincms.entryDomain.dao.CmsArticle entry=null;
        CmsArticleEntryService service=new CmsArticleEntryService();
         int aid=Integer.parseInt(request.getParameter("aid"));
        entry=  service.get(aid);
        
            if(entry==null){
                //
            }
      //load article content
         String realPath=request.getSession().getServletContext()
                 .getRealPath("/");
         
     miincms.entryDomain.dao.CmsArticle article=entry;
         String contentFile=article.getContentfilePath();
      String pathweb=realPath+"/"+contentFile;
       File f=new File(pathweb);
       
       MiinWebDocIoUtil docUtil=new MiinWebDocIoUtil (realPath);
        File file=   docUtil.getWebFile(contentFile);
           
        String cotent=  docUtil.readFile(file, "utf-8");
%>


<p>网站目录：<%=realPath%></p>

<p>文章：<%=contentFile%></p>

<p>文章路径：<%=file.getPath()%></p>
<p>文章路径2：<%=pathweb%></p>
<p>文章 内容：<%=cotent%></p>


    </body>
</html>
