我更改了应用程序的工作流程,删除了之前使用过的4个操作。
我改变了,以至于我不再有信用卡,achsaved和其他几个动作。
在我的日志文件中,我收到错误
"payment.creditcardsaved action not found"
其他3个操作未记录相同的问题。我搜索了我的项目,并没有在任何地方引用信任的行动。我仍然渲染该模板,但我直接用renderTemplate(“Payment / CreditCardSaved.html”,args)渲染它;
以前控制器中有一个方法
public static void creditcardsaved() {}
保存方法public static void SaveCreditCard
保存了付款,然后调用了creditcardsaved()操作。从任何观点都没有提到行动。
我不再需要对creditcardsaved()进行单独操作,我不希望它出现在网址中。
因此,我没有在SaveCreditCard方法结束时调用它,而是更改为renderTemplate(“Payment / CreditCardSaved.html”,args);
屏幕上的输出与之前的输出相匹配,但网址应为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
答案 0 :(得分:2)
检查您的路线文件。您可能忘记删除其中的操作。
答案 1 :(得分:0)
确保您的所有视图都没有引用creditcardsaved()。寻找像@ {payment.creditcardsaved()}这样的标签。此外,Play非常擅长的一件事是在浏览器中返回有用的错误消息。如果您能找到失败的页面,它将指向正确的方向。如果您仍需要帮助,也可以发布该信息。