JFinal笔记

1   JFinalConfig中五个方法

 

    1.1     configConstant

    @Override
    public void configConstant(Constants me) {
        me.setDevMode(true);            //设置开发模式
        me.setBaseDownloadPath("");        //设置文件渲染的默认路劲
        me.setBaseUploadPath("");        //设置文件上传默认路径
        me.setBaseViewPath("");            //设置路由试图的默认路劲
        me.setEncoding("utf-8");        //设置JFinal默认编码
        me.setError401View("401.jsp");    //设置401错误的默认视图
        me.setError403View("403.jsp");  //设置403错误的默认视图
        me.setErrorRenderFactory(null); //设置错误试图工厂
        me.setErrorView(404, "404.jsp");//设置错误对应的试图
        me.setFreeMarkerViewExtension("");//设置FreeMarker默认扩展名,不设置即为.html
        
        
        
    }

 

2   请求参数传到后台怎么得到

getPara

getBean

getModul

 

3  上传文件

  config中configConstant配置最大文件大小----me.setMaxPostSize(1024 * 1024 * 20);

  getFile() 

  html中的代码如下:

<body>
    This is my Hello HTML page. <br>
    <form action="/test3" method="post" enctype="multipart/form-data">
    <input type="file"  name="uploadFile" id="uploadFile"/>
    <input type="submit" value="上传"/>
    </form>
  </body>

 

posted on 2016-10-02 00:24  编世界  阅读(224)  评论(0编辑  收藏  举报