1 JFinalConfig中五個方法html
1.1 configConstantjsp
@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 請求參數傳到後臺怎麼獲得ide
getParapost
getBean編碼
getModulspa
3 上傳文件3d
config中configConstant配置最大文件大小----me.setMaxPostSize(1024 * 1024 * 20);code
getFile() orm
html中的代碼以下:htm
<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>