我更改了我的应用程序的工作流程,删除了之前使用的 4 个操作。
我进行了更改,不再保存 creditcards、achsave 和其他一些操作。
在我的日志文件中我得到了错误
"payment.creditcardsaved action not found"
The other 3 actions have not logged the same problem. I have searched through my project, and I'm not referencing the creditcardsaved action anywhere. I do still render that template, but I render it directly with renderTemplate("Payment/CreditCardSaved.html", args);
Previously there was a method in the controller
public static void creditcardsaved() {}
保存方法 public static void SaveCreditCard
保存付款,然后调用 creditcardsaved() 操作。从任何 View 都没有提及该操作。
我不再希望对 creditcardsaved() 执行单独的操作,我不希望它出现在 url 中。
所以我没有在 SaveCreditCard 方法的末尾调用它,而是改为 renderTemplate("Payment/CreditCardSaved.html", args);
屏幕上的输出将与之前的输出相匹配,但 url 应该是 SaveCreditCard。我还删除了 creditcardsaved() 方法,因此不会从任何地方意外调用它。
错误的错误完整堆栈跟踪是。
ERROR play - @67bi2d4oj payment.creditcardsaved action not found Action not found Action payment.creditcardsaved could not be found. Error raised is No method public static void creditcardsaved() was found in class controllers.payment play.exceptions.ActionNotFoundException: Action payment.creditcardsaved not found at play.mvc.ActionInvoker.getActionMethod(ActionInvoker.java:447) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:76) at play.server.ServletWrapper$ServletInvocation.execute(ServletWrapper.java:472) at play.Invoker$Invocation.run(Invoker.java:187) at play.server.ServletWrapper$ServletInvocation.run(ServletWrapper.java:463) at play.Invoker.invokeInThread(Invoker.java:61) at play.server.ServletWrapper.service(ServletWrapper.java:113) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:445) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:504) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:301) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:275) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1016) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:639) at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1772) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1563) Caused by: java.lang.Exception: No method public static void creditcardsaved() was found in class controllers.payment ... 32 more
最佳答案
检查你的路由文件。您可能会忘记从中删除操作。
关于java - 当代码未引用该操作时,为什么我会收到 Action not found?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7066708/