我在 WebSphere 上使用 JSF 1.1 (MyFaces 1.1.8) 时遇到问题。在 Tomcat 5.5 上部署我的应用程序时,此行为不适用并且一切正常。
当我尝试从 Ogone(支付网关)发回的 URL 中读取参数,再次加入我的 JSF 会话(会话仍然存在)时,QueryString 无法通过
final HttpServletRequest request = (HttpServletRequest)FacesContext
.getCurrentInstance().getExternalContext().getRequest();
String qs = request.getQueryString(); // null on WebSphere, filled on Tomcat
Run Code Online (Sandbox Code Playgroud)
为了更完整一点,查询字符串看起来像这样:
http://100.100.100.100:9080/my_app_context/pages/screen7.jsf?orderID=4208013442596271¤cy=EUR&amount=60&PM=iDEAL&ACCEPTANCE=0000000000&STATUS=9&CARDNO=11-XXXX-11&ED=&CN=K%C3%A9m+Birdy&TRXDATE=08%2F06%2F12&PAYID=15879916&NCERROR=0&BRAND=iDEAL&COMPLUS=personID%3D01%26subscriptionID%3D02&IP=100.100.100.100&SHASIGN=9642468EE016BD49787B62EA7231124B3C24F9BBFC5B3B3B4D9E97D678979E57E5EED9B47D611441A6FCA2EB1D2DB87348C8111ACFF366A4E244106CCCFAFDA5
Run Code Online (Sandbox Code Playgroud)
我正在考虑一些可能会阻止容器正确处理外部请求的 WebSphere webcontainer 设置。或者这里可能存在一些类加载问题,但我一直无法找到它。
WebSphere 上的堆栈跟踪是这样的:
12-08-07 08:02:26 ERROR -
java.lang.NullPointerException
at ... own code trying to getQueryString()...
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:459)
at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
at org.apache.myfaces.custom.security.SecurityContextPropertyResolver.getValue(SecurityContextPropertyResolver.java:101)
at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:539)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
at javax.faces.component.UIOutput.getValue(UIOutput.java:118)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getValue(RendererUtils.java:267) …Run Code Online (Sandbox Code Playgroud)