@绝望的八皮 你好,想跟你请教个问题:
jfinal-ext 关于PoiRender导出excel但是无数据.
导出excel----carInfo.xls但是里面没有数据,后台报错。
引用jar包:jfinal 2.0 jfinal-ext 3.1.4
代码如下:
public void carsToExc(){ UserRecord user= getSessionAttr("user"); System.out.println(getAttr("draw")); System.out.println(getAttr("start")); System.out.println(getAttr("length")); int userid=user.getInt("id"); List<CarinfoRecord> objs= carInfoService.findCarsByUser(userid); System.out.println(JSON.toString(objs)); String [] header={"编号","证件号码","加入时间","驾龄","电话"}; String [] columns={"id","transport_license","create_time","driving_time","phone_number"}; Render poiRender=PoiRender.me(objs).fileName("carInfo.xls").headers(header).columns(columns).cellWidth(5000).headerRow(2); render(poiRender); }
[ERROR]-[Thread: qtp29585222-15]-[com.jfinal.core.ActionHandler.handle()]: /carInfo/carsToExc java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook at com.jfinal.ext.render.excel.PoiRender.render(PoiRender.java:57) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:93) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:365) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383) ... 26 more 2015-11-17 13:56:15 [ERROR]-[Thread: qtp29585222-15]-[com.jfinal.core.JFinalFilter.doFilter()]: /carInfo/carsToExc java.lang.IllegalStateException: STREAM at org.eclipse.jetty.server.Response.getWriter(Response.java:699) at com.jfinal.render.ErrorRender.render(ErrorRender.java:59) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:126) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:365) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:744)
{id:1, phone_number:123, driving_time:12, transport_license:D10D9554A7994A17AE25F182701FFC60, create_time:2015-07-23 09:40:32, plate_number:鄂A12345, transport_user:张三}","com.jiexun.jiexun56.mvc.record.CarinfoRecord@de367719 {id:2, phone_number:null, driving_time:null, transport_license:null, create_time:null, plate_number:鄂A32423, transport_user:null}","com.jiexun.jiexun56.mvc.record.CarinfoRecord@633a0bfe {id:3, phone_number:123, driving_time:12, transport_license:D10D9554A7994A17AE25F182701FFC60, create_time:2015-07-23 09:40:32, plate_number:鄂A1345, transport_user:张三}","com.jiexun.jiexun56.mvc.record.CarinfoRecord@633a0c0b {id:4, phone_number:123, driving_time:12, transport_license:D10D9554A7994A17AE25F182701FFC60, create_time:2015-07-23 09:40:32, plate_number:鄂A1347, transport_user:张三}
@<atarget="_blank"rel="nofollow">JFinal<atarget="_blank"rel="nofollow">@<atarget="_blank"rel="nofollow">JFinal
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。