理衣烦 2020-03-12 10:18 采纳率: 50%
浏览 1289
已采纳

在JSP中的<c:forEach items="${list}" var="publish" varStatus="status">想更换数据表publish为book,更换后无法显示,请问各位大神怎么解决该问题?

一开始在我的JSP项目中,正常运行显示,后来发现页面显示时,数据库中的数据表显示错误,我在页面当中显示的是数据库library中publish表中的数据信息,但实际上我需要的是数据库library中book表中的信息,替换数据表后,用标签遍历查询,却显示空白,连表格框架都消失了,请问我该如何修改,才能将表publish成功替换成表book?恳求各位大佬指点,感激不尽!

如下,为publish表成功显示的图片
图片说明

如下,为book表显示失败的图片
图片说明

<!--以下为publish表显示成功的代码-->
<c:forEach items="${list}" var="publish" varStatus="status">
                                                <c:choose>
                                                   <c:when test="${status.index%2 == '0'}">
                                                        <tr class="odd">
                                                            <td>${status.index+ 1}</td>
                                                            <td>${publish.name}</td>
                                                            <td>${publish.addr}</td>
                                                            <td>${publish.tel}</td>
                                                            <td>${book.price}</td>
                                                            <td>
                                                                <a href="<%=basePath%>publish/form?id=${book.id}">修改</a>
                                                                <a href="<%=basePath%>publish/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a>
                                                            </td>
                                                        </tr>
                                                   </c:when>
                                                   <c:otherwise>
                                                        <tr class="even">
                                                            <td>${status.index+ 1}</td>
                                                            <td>${publish.name}</td>
                                                            <td>${publish.addr}</td>
                                                            <td>${publish.tel}</td>
                                                            <td>${book.price}</td>
                                                            <td>
                                                                <a href="<%=basePath%>publish/form?id=${book.id}">修改</a>
                                                                <a href="<%=basePath%>publish/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a>
                                                            </td>
                                                        </tr>
                                                   </c:otherwise>
                                            </c:choose>
                                        </c:forEach>



<!--以下为更改后book表显示失败的代码-->
<!--以下为更改后book表显示失败的代码-->
<!--以下为更改后book表显示失败的代码-->
<!--以下为更改后book表显示失败的代码-->
<c:forEach items="${list}" var="book" varStatus="status">
                                                <c:choose>
                                                   <c:when test="${status.index%2 == '0'}">
                                                        <tr class="odd">
                                                            <td>${status.index+ 1}</td>
                                                            <td>${book.name}</td>
                                                            <td>${book.code}</td>
                                                            <td>${book.auther}</td>
                                                            <td>${book.price}</td>
                                                            <td>
                                                                <a href="<%=basePath%>book/form?id=${book.id}">修改</a>
                                                                <a href="<%=basePath%>book/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a>
                                                            </td>
                                                        </tr>
                                                   </c:when>
                                                   <c:otherwise>
                                                        <tr class="even">
                                                            <td>${status.index+ 1}</td>
                                                            <td>${book.name}</td>
                                                            <td>${book.code}</td>
                                                            <td>${book.author}</td>
                                                            <td>${book.price}</td>
                                                            <td>
                                                                <a href="<%=basePath%>book/form?id=${book.id}">修改</a>
                                                                <a href="<%=basePath%>book/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a>
                                                            </td>
                                                        </tr>
                                                   </c:otherwise>
                                            </c:choose>
                                        </c:forEach>

当运行publish表那张图显示的项目时,无报错

2020-3-12 10:12:16 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8.
2020-3-12 10:12:16 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2020-3-12 10:12:17 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013)
2020-3-12 10:12:17 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
2020-3-12 10:12:17 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
2020-3-12 10:12:17 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 849 ms
2020-3-12 10:12:17 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
2020-3-12 10:12:17 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.52
2020-3-12 10:12:17 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\Code
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
2020-3-12 10:12:28 org.apache.tomcat.websocket.server.WsSci onStartup
信息: JSR 356 WebSocket (Java WebSocket 1.0) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocketJARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available.
2020-3-12 10:12:28 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath

2020-3-12 10:12:29 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2020-3-12 10:12:41 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'springServlet'
========= Enabled refresh mybatis mapper =========
2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\docs
2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\examples
2020-3-12 10:13:00 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2020-3-12 10:13:00 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2020-3-12 10:13:00 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@fa4b23')
2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\host-manager
2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\igeek
2020-3-12 10:13:00 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\MyEclipse\Tomcat7.0\webapps\igeek\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
2020-3-12 10:13:01 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\library
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://www.springframework.org/tags/form is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://www.springframework.org/tags is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
2020-3-12 10:13:04 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
2020-3-12 10:13:04 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\manager
2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\ROOT
2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\springmvc03fAjax
2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\springmvc03LYF
2020-3-12 10:13:16 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://www.springframework.org/tags/form is already defined
2020-3-12 10:13:16 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://www.springframework.org/tags is already defined
2020-3-12 10:13:16 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
2020-3-12 10:13:16 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\SSH
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
2020-3-12 10:13:27 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath

欢迎使用 JeeSite 快速开发平台  - Powered By http://jeesite.com

2020-3-12 10:13:28 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2020-03-12 10:13:32,591 WARN [net.sf.ehcache.DiskStorePathManager] - diskStorePath '..\temp\jeesite\ehcache' is already used by an existing CacheManager either in the same VM or in a different process.
The diskStore path for this CacheManager will be set to ..\temp\jeesite\ehcache\ehcache_auto_created4673197487363253977diskstore.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
2020-03-12 10:13:32,657 WARN [sf.ehcache.store.disk.DiskStorageFactory] - Data in persistent disk stores is ignored for stores from automatically created directories.
Remove diskPersistent or resolve the conflicting disk paths in cache configuration.
Deleting data file D:\MyEclipse\Tomcat7.0\bin..\temp\jeesite\ehcache\ehcache_auto_created4673197487363253977diskstore\active%0053essions%0043ache.data
2020-3-12 10:13:41 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'springServlet'
========= Enabled refresh mybatis mapper =========
2020-3-12 10:13:50 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
2020-3-12 10:13:50 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
2020-3-12 10:13:50 org.apache.catalina.startup.Catalina start
信息: Server startup in 92843 ms

当运行book表那张图显示的项目时,出现报错
报错信息:

2020-3-12 10:14:33 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'springmvc'
2020-3-12 10:14:36 org.apache.jasper.compiler.TldLocationsCache tldScanJar
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2020-3-12 10:14:38 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
javax.el.PropertyNotFoundException: Property 'code' not found on type com.library.entity.Publish
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
at javax.el.BeanELResolver.property(BeanELResolver.java:317)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:182)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
at org.apache.jsp.WEB_002dINF.jsp.publishList_jsp._jspService(publishList_jsp.java:708)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
2020-3-12 10:14:38 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springmvc] in context with path [/library] threw exception [An exception occurred processing JSP page /WEB-INF/jsp/publishList.jsp at line 123

120:


121: ${status.index+ 1}
122: ${book.name}
123: ${book.code}
124: ${book.auther}
125: ${book.price}
126:

Stacktrace:] with root cause
javax.el.PropertyNotFoundException: Property 'code' not found on type com.library.entity.Publish
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
at javax.el.BeanELResolver.property(BeanELResolver.java:317)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:182)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
at org.apache.jsp.WEB_002dINF.jsp.publishList_jsp._jspService(publishList_jsp.java:708)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

  • 写回答

1条回答 默认 最新

  • 专家-郭老师 Java领域新星创作者 2020-03-12 11:31
    关注

    第一步你要看后台是不是查询到数据,其次你有对比这两个表的数据结构吗?是一样吗?你就开始复用?
    你这个错误就是告诉你为找到code这个字段
    123: ${book.code} 这个根本找不到,都报错了,表格当然出不来了。
    Property 'code' not found on type com.library.entity.Publish 你都换表查询了,咋还用publish这个对象来接收?不换车book?你这个定义List

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 系统 24h2 专业工作站版,浏览文件夹的图库,视频,图片之类的怎样删除?
  • ¥15 怎么把512还原为520格式
  • ¥15 MATLAB的动态模态分解出现错误,以CFX非定常模拟结果为快照
  • ¥15 求高通平台Softsim调试经验
  • ¥15 canal如何实现将mysql多张表(月表)采集入库到目标表中(一张表)?
  • ¥15 wpf ScrollViewer实现冻结左侧宽度w范围内的视图
  • ¥15 栅极驱动低侧烧毁MOSFET
  • ¥30 写segy数据时出错3
  • ¥100 linux下qt运行QCefView demo报错
  • ¥50 F1C100S下的红外解码IR_RX驱动问题