This content has been marked as final.
Show 1 reply
-
1. Re: How to pass remote user using Http request
ssilvert Nov 30, 2009 8:49 AM (in response to noolena)Hi noolena,
Thanks for the kind words.
Note that when you are inside a JSFUnit test, ExternalContext.getRequest() can yield unexpected results. This is documented in the javadoc. The reason is because the container may recycle the HttpServletRequest object at the end of the request.
JSFUnit will cache the remote user in the JSFUnitExternalContext. So the way to get the remote user in a JSFUnit test is to call:
FacesContext.getExternalContext().getRemoteUser();
Hope that helps. If not, can you post your code so I can get a better idea of what you are trying to do?
Stan