我一直在绞尽脑汁。我收到此错误消息"行号0超出范围。"
<cfparam name="Form.#PartNumberVar#" default="">
---- Error on the line below ----
<td><cfinput type="text" value="#Form[PartNumberVar]#" class="prodQuantity" name="#PartNumber#" validate="integer" message="Please enter whole numbers into the Quantity Field."></td>
我很难过。
从我在Error StackTrace中看到的内容:Detail [空字符串],ErrNumber 0
堆栈跟踪: coldfusion.runtime.QueryFunction $ RowNumberOutOfBoundException:行号0超出范围。 at coldfusion.runtime.QueryFunction.QuerySetCell(QueryFunction.java:499)at coldfusion.runtime.QueryFunction.QuerySetCell(QueryFunction.java:332)at coldfusion.runtime.CFPage.QuerySetCell(CFPage.java:1258)at cfNewTreadsDisplay2ecfm1920230382.runPage( E:\ WebSites \ MOTest \ MO \ ordering \ Includes \ NewTestDisplay.cfm:133)at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:734) )来自coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:570)at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2986)at cfTestingDST2ecfm847829206.runPage(E:\ WebSites \ MOTest \ MO \ ordering \ Includes \ testingDST.cfm:131)coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:734)at coldfusion.tagext.lang.IncludeTag.doStartTag( IncludeTag.java:570)在cfTesting2ecfm1463952034.runPage(E:\ WebSites \ M)的coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2986) OTest \ MO \ ordering \ Testing.cfm:368)coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:734)at coldfusion.tagext.lang .includeTag.doStartTag(IncludeTag.java:570)位于coldfusion.filter.App.Ferter.invoke的Coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)和coldfusion.filter.ApplicationFilter.invoke(IpFilter.java:45) ApplicationFilter.java:487)在coldfusion.filter.MilitoringFilter.invoke(MonitoringFilitor.java:40)的coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)处于coldfusion.filter.PathFilter.invoke(PathFilter.java:141) )coldfusion.filter.ExterFilter.invoke(ExceptionFilter.java:94)at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:78)at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)at coldfusion.filter coldfusion.filter.NoCacheFilter.invoke上的.BrowserFilter.invoke(BrowserFilter.java:38)(NoCacheF) ilter.java:58)at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62 )在coldfusion.filterFilter.invoke(RequestThrottleFilter.java:151)的coldfusion.CfmServlet.service(CfmServlet.java:219)at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)at org.apache.catalina .core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)位于org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)的coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)at at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)中的coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)位于org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 208)在org.apache.cat alina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java: 501)org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)atg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)at org.apache.catalina.core.StandardEngineValve .invoke(StandardEngineValve.java:116)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:198)org。 apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:607)atg.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:313)at java.util.concurrent.ThreadPoolExecutor.runWorker( java.util.concurrent.ThreadPoolExecutor上的未知来源)java.lang.Thread.run上的$ Worker.run(未知来源)(未知的Sourc) e)
答案 0 :(得分:4)
也许您正在尝试将值设置为第0行,但查询的行号从1开始。 如果你这样做了,你可能会收到这个错误。
如果您无法理解我,请尝试使用此代码。
<cfset test = queryNew("Name,WorkPlace")> <!--- You should use queryAddRow() for using r0w number 1 ---> <cfset queryAddRow(test)> <!--- Please test this with 1's instead of 0's ---> <cfset querySetCell(test, "Name", 'XXXXX', 0)> <cfset querySetCell(test, "WorkPlace", 'YYYYYY', 0)> <cfdump var="#test#" />