Author: anil.saldhana(a)jboss.com
Date: 2011-05-10 19:50:51 -0400 (Tue, 10 May 2011)
New Revision: 930
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java
Log:
use the JBAS way of getting servlet request as backup
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java
===================================================================
---
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java 2011-05-05
09:22:20 UTC (rev 929)
+++
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java 2011-05-10
23:50:51 UTC (rev 930)
@@ -25,6 +25,8 @@
import java.util.List;
import java.util.StringTokenizer;
+import javax.security.jacc.PolicyContext;
+import javax.security.jacc.PolicyContextException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.xml.namespace.QName;
@@ -276,7 +278,19 @@
*/
private HttpServletRequest getHttpRequest(MessageContext msgContext)
{
- return (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
+ HttpServletRequest request = (HttpServletRequest)
msgContext.get(MessageContext.SERVLET_REQUEST);
+ if( request == null)
+ {
+ try
+ {
+ request = (HttpServletRequest)
PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
+ }
+ catch (PolicyContextException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return request;
}
/**
Show replies by date