Spring webflow 和 PrimeFaces 表达式语言 - bean 方法被解释为 websphere 中的一个属性,但不是 tomcat



我有一个WebFlow输入:

<input name="allocationConfig" required="true"/>

,然后在搜索PrimeFaces自动完成输入中的商店列表时使用它来获得正确的控制器:

<p:autoComplete completeMethod="#{controllerLookup.get(allocationConfig).searchForStore}" ... />

controllerLookup是一个Spring bean,当从webflow传递allocationConfig时返回一个特定的控制器(这也是一个Spring bean)。然后控制器返回一个商店列表,以显示在自动完成输入中。

当我在Tomcat上运行它时,它可以正常工作,但是当它部署到Websphere上时,我得到这个错误:

javax.el.PropertyNotFoundException: /WEB-INF/flows/manage-allocation/manage-allocation.xhtml @76,97 completeMethod="#{controllerLookup.get(allocationConfig).searchForStore}": Property 'get' not found on type com.web.controller.allocations.ControllerLookup
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(Unknown Source)
    at org.primefaces.component.autocomplete.AutoComplete.broadcast(AutoComplete.java:459)
    at javax.faces.component.UIViewRoot.broadcastEvents(Unknown Source)
    at javax.faces.component.UIViewRoot.processDecodes(Unknown Source)
    at org.springframework.faces.webflow.FlowLifecycle.invokePhase(FlowLifecycle.java:88)
    at org.springframework.faces.webflow.FlowLifecycle.execute(FlowLifecycle.java:69)
    at org.springframework.faces.webflow.JsfView.processUserEvent(JsfView.java:111)
    at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:225)
    at org.springframework.webflow.engine.ViewState.resume(ViewState.java:195)
    at org.springframework.webflow.engine.Flow.resume(Flow.java:537)
    at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
    at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
    at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:228)
    at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:57)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
    at com.pcmsgroup.v21.web.config.AuthFilter.doFilter(AuthFilter.java:46)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:964)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1104)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:914)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    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:1865)

似乎Websphere错误地将controllerLookup.get解释为属性,而Tomcat正确地将其解释为方法。

你知道为什么Tomcat和Websphere对我的EL的解释不同吗?或者如何修复它?

我已经想出了一个解决方案,目前为止似乎有效。

我已经将查找方法的签名更改为不带任何参数的getController。相反,它从Spring的流作用域获取配置对象:

public AllocationsController getController() {
    AllocationConfig config = (AllocationConfig) RequestContextHolder.getRequestContext().getFlowScope().get("allocationConfig");
    // Determine the concrete type of controller depending on the config, and return it.
}

autocomplete输入的标签:

<p:autoComplete completeMethod="#{controllerLookup.controller.searchForStore}" ... />

相关内容

  • 没有找到相关文章

最新更新