@At("querybook")
@Ok("jsp:book")
public List<User> querybook(HttpServletRequest request){
Sql sql = Sqls.create("SELECT * FROM sys_user LEFT JOIN u_book ON sys_user.id = u_book.userId");
dao.execute(sql)
问答
写完自定义sql语句之后 如何将sql查寻结果保存到集合中返回给jsp页面
标签:
无
10 回复
多看文档啊
Sql sql = Sqls.queryEntites("SELECT * FROM sys_user LEFT JOIN u_book ON sys_user.id = u_book.userId");
sql.setEntity(dao.getEntity(User.class));
dao.execute(sql);
return sql.getList(User.class);
jsp代码
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<form action="addbook">
<c:forEach items="{querybook}" var="books">
<div>书名${books.Book.name}</div>
</c:forEach>
</form>
</body>
</html>
报错信息
javax.el.PropertyNotFoundException: Property 'Book' not found on type java.lang.String
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:268) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:221) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.property(BeanELResolver.java:355) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.getValue(BeanELResolver.java:95) ~[el-api.jar:3.0.FR]
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110) ~[jasper.jar:8.0.38]
at org.apache.el.parser.AstValue.getValue(AstValue.java:169) ~[jasper-el.jar:8.0.38]
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) ~[jasper-el.jar:8.0.38]
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:943) ~[jasper.jar:8.0.38]
at org.apache.jsp.WEB_002dINF.book_jsp._jspx_meth_c_005fforEach_005f0(book_jsp.java:174) ~[?:?]
at org.apache.jsp.WEB_002dINF.book_jsp._jspService(book_jsp.java:129) ~[?:?]
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64) ~[log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318) [catalina.jar:8.0.38]
at org.nutz.mvc.view.ForwardView.render(ForwardView.java:72) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.38]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.38]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:313) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:86) [catalina.jar:8.0.38]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.38]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) [catalina.jar:8.0.38]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100) [tomcat-coyote.jar:8.0.38]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) [tomcat-coyote.jar:8.0.38]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_77]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.38]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
2017-07-06 11:36:08[INFO ]org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/][203]-11:36:07.430 DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [GET] path=/querybook : LoginController.querybook(LoginController.java:70)
11:36:07.430 DEBUG org.nutz.ioc.impl.NutIoc - Get 'loginController'<class team.chance.simple.module.web.controller.LoginController>
11:36:07.607 DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM sys_user LEFT JOIN u_book ON sys_user.id = u_book.userId
11:36:08.140 WARN org.nutz.mvc.impl.processor.FailProcessor - Error@/querybook :
org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/book.jsp at line 17
14: <body>
15: <form action="addbook">
16: <c:forEach items="{querybook}" var="books">
17: <div>涔﹀悕${books.Book.name}</div>
18: </c:forEach>
19: </form>
20: </body>
Stacktrace:
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:579) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64) ~[log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318) ~[catalina.jar:8.0.38]
at org.nutz.mvc.view.ForwardView.render(ForwardView.java:72) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.38]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.38]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:313) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:86) [catalina.jar:8.0.38]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.38]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) [catalina.jar:8.0.38]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100) [tomcat-coyote.jar:8.0.38]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) [tomcat-coyote.jar:8.0.38]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_77]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.38]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
Caused by: javax.el.PropertyNotFoundException: Property 'Book' not found on type java.lang.String
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:268) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:221) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.property(BeanELResolver.java:355) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.getValue(BeanELResolver.java:95) ~[el-api.jar:3.0.FR]
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110) ~[jasper.jar:8.0.38]
at org.apache.el.parser.AstValue.getValue(AstValue.java:169) ~[jasper-el.jar:8.0.38]
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) ~[jasper-el.jar:8.0.38]
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:943) ~[jasper.jar:8.0.38]
at org.apache.jsp.WEB_002dINF.book_jsp._jspx_meth_c_005fforEach_005f0(book_jsp.java:174) ~[?:?]
at org.apache.jsp.WEB_002dINF.book_jsp._jspService(book_jsp.java:129) ~[?:?]
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438) ~[jasper.jar:8.0.38]
... 56 more
求指导,我在网上查了,说是中间有空格 但我这个没有空格 不知道怎么回事
jsp代码
<html>
<head>
<title>Title</title>
</head>
<body>
<form action="addbook">
<c:forEach items="{querybook}" var="books">
<div>书名${books.name}</div>
</c:forEach>
</form>
</body>
</html>
报错信息
javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:268) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:221) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.property(BeanELResolver.java:355) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.getValue(BeanELResolver.java:95) ~[el-api.jar:3.0.FR]
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110) ~[jasper.jar:8.0.38]
at org.apache.el.parser.AstValue.getValue(AstValue.java:169) ~[jasper-el.jar:8.0.38]
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) ~[jasper-el.jar:8.0.38]
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:943) ~[jasper.jar:8.0.38]
at org.apache.jsp.WEB_002dINF.book_jsp._jspx_meth_c_005fforEach_005f0(book_jsp.java:174) ~[?:?]
at org.apache.jsp.WEB_002dINF.book_jsp._jspService(book_jsp.java:129) ~[?:?]
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64) ~[log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318) [catalina.jar:8.0.38]
at org.nutz.mvc.view.ForwardView.render(ForwardView.java:72) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.38]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.38]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:313) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:86) [catalina.jar:8.0.38]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.38]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) [catalina.jar:8.0.38]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100) [tomcat-coyote.jar:8.0.38]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) [tomcat-coyote.jar:8.0.38]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_77]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.38]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
2017-07-06 12:10:12[INFO ]org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/][203]-12:10:12.000 DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [GET] path=/querybook : LoginController.querybook(LoginController.java:70)
12:10:12.001 DEBUG org.nutz.ioc.impl.NutIoc - Get 'loginController'<class team.chance.simple.module.web.controller.LoginController>
12:10:12.205 DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM sys_user LEFT JOIN u_book ON sys_user.id = u_book.userId
12:10:12.948 WARN org.nutz.mvc.impl.processor.FailProcessor - Error@/querybook :
org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/book.jsp at line 17
14: <body>
15: <form action="addbook">
16: <c:forEach items="{querybook}" var="books">
17: <div>涔﹀悕${books.name}</div>
18: </c:forEach>
19: </form>
20: </body>
Stacktrace:
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:579) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) ~[jasper.jar:8.0.38]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64) ~[log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391) ~[catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318) ~[catalina.jar:8.0.38]
at org.nutz.mvc.view.ForwardView.render(ForwardView.java:72) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202) [nutz-1.r.62-SNAPSHOT.jar:1.r.62-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.8.2.jar:2.8.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.38]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.38]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.38]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:313) [catalina.jar:8.0.38]
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:86) [catalina.jar:8.0.38]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [catalina.jar:8.0.38]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.38]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) [catalina.jar:8.0.38]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100) [tomcat-coyote.jar:8.0.38]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) [tomcat-coyote.jar:8.0.38]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) [tomcat-coyote.jar:8.0.38]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_77]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.38]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
Caused by: javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:268) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:221) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.property(BeanELResolver.java:355) ~[el-api.jar:3.0.FR]
at javax.el.BeanELResolver.getValue(BeanELResolver.java:95) ~[el-api.jar:3.0.FR]
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110) ~[jasper.jar:8.0.38]
at org.apache.el.parser.AstValue.getValue(AstValue.java:169) ~[jasper-el.jar:8.0.38]
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) ~[jasper-el.jar:8.0.38]
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:943) ~[jasper.jar:8.0.38]
at org.apache.jsp.WEB_002dINF.book_jsp._jspx_meth_c_005fforEach_005f0(book_jsp.java:174) ~[?:?]
at org.apache.jsp.WEB_002dINF.book_jsp._jspService(book_jsp.java:129) ~[?:?]
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[jasper.jar:8.0.38]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:?]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438) ~[jasper.jar:8.0.38]
... 56 more
呃....还是这个错,求指导
@At("querybook")
@Ok("jsp:book")
public List<User> querybook(HttpServletRequest request){
Sql sql = Sqls.create("SELECT * FROM sys_user LEFT JOIN u_book ON sys_user.id = u_book.userId");
sql.setEntity(dao.getEntity(User.class));
dao.execute(sql);
return sql.getList(User.class);
求指导,谢谢
@At("querybook")
@Ok("jsp:book")
public List<User> querybook(HttpServletRequest request){
List<User> users = dao.query(User.class, null);
dao.fetchLinks(users, null);
return users;
}
<c:forEach items="${obj}" var="user">
<div>用户名: ${user.name}</div>
<c:forEach items="${user.books}" var="book">
<div>书名${book.name}</div>
</c:forEach>
</c:forEach>
添加回复
请先登陆