Author: chris.laprun(a)jboss.com
Date: 2007-03-21 17:18:05 -0400 (Wed, 21 Mar 2007)
New Revision: 6797
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ServletAccess.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/UserAccess.java
Log:
- Fixed tests.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ServletAccess.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ServletAccess.java 2007-03-21
21:04:26 UTC (rev 6796)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ServletAccess.java 2007-03-21
21:18:05 UTC (rev 6797)
@@ -84,7 +84,8 @@
public static HttpServletRequest getRequest()
{
- return (HttpServletRequest)((Invocation)local.get()).req;
+ Invocation invocation = (Invocation)local.get();
+ return invocation != null ? (HttpServletRequest)invocation.req : null;
}
public static HttpServletResponse getResponse()
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/UserAccess.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/UserAccess.java 2007-03-21 21:04:26
UTC (rev 6796)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/UserAccess.java 2007-03-21 21:18:05
UTC (rev 6797)
@@ -38,7 +38,7 @@
public static String getUser()
{
HttpServletRequest req = ServletAccess.getRequest();
- return req.getRemoteUser();
+ return req != null ? req.getRemoteUser() : null;
}
public static UserContext getUserContext()
@@ -46,4 +46,4 @@
String userId = getUser();
return userId != null ? WSRPTypeFactory.createUserContext(userId) : null;
}
-}
+}
\ No newline at end of file
Show replies by date