William,
Imagine the string returned is this:
XXX\bbb
You can't just throw this into a JS string without encoding it. Put this into
your browser URL bar:
javascript:alert('XXX\bbb')
Now put this in it:
javascript:alert('XXX\bbb')
So what I'd do is:
function envRemoteUserDomain() {
var returnvalue = "<%= request.getRemoteUser().replaceAll("\\", "\\\\")
%>";
}
(I haven't tested that.)
Which will turn \ into \\ (even though you can see \\ and \\\\, given you
can't just put \ into a Java string without encoding it).
Although, I wouldn't do it quite like that given it's not always going to work
(request.getRemoteUser() can quite happily return null). What you need to do
is find the posting I made on this topic sometime before Christmas, perhaps
in October or November.
John
Java System Solutions : http://www.javasystemsolutions.com
UNSUBSCRIBE or access ARSlist Archives at http://www.ARSLIST.org