Jfinal + jetty 8 出现 form too large问题

// JFinal修改Jetty MaxFormContentSize参数
if (JFinal.me().getServletContext().getClass().getName().equals("org.eclipse.jetty.webapp.WebAppContext$Context")) {
try {
ServletContext ctx = JFinal.me().getServletContext();
Method getContextHandler = ctx.getClass().getMethod("getContextHandler", null);
Object handler = getContextHandler.invoke(ctx, null);
Method setMax = handler.getClass().getMethod("setMaxFormContentSize", int.class);
setMax.invoke(handler, 1024 * 1024 * 100);
} catch (Exception e) {
e.printStackTrace();
}
}
放在afterJFinalStart()里

 

posted @ 2018-01-05 18:38  icuke  阅读(558)  评论(0编辑  收藏  举报