AJAX postSync not allowing partial-response redirect?

I am using encountering an issue where the DHTMLX Ajax postSync doesn’t seem to allow the Browser to handle a partial-response redirect as expected.
Response:

<?xml version="1.0" encoding="UTF-8"?>

Error seen:
unterminated regular expression literal
…machine:3333/CD/login/’></partial-response
--------------------------------------------------^

Is there something I can do to format the response so it can pass through correctly?

JavaScript Ajax call:
configLoader = dhtmlxAjax.postSync("/CD/setDbBackupConfig",configParams);
tempResult = eval(’(’ + configLoader.xmlDoc.responseText + ‘)’);

Java code intercepts this request and forces the redirect response:

if(isAJAX) {

                    String url = MessageFormat.format(
                    "{0}://{1}:{2,number,####0}{3}/login/",
                    request.getScheme(), request.getServerName(),
                    request.getServerPort(),
                            httpServletRequest.getContextPath());

                    PrintWriter pw = response.getWriter();
                    pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    pw.println("<partial-response><redirect url=\'" + url + "\'></redirect></partial-response>");
                    pw.flush();

                } 

Context as to why I am doing this:
My application uses Spring security 3.0. That security redirects the user to a timeout page is the session has expired. BUT out-of-the-box it simply returns the entire HTML timeout page to any AJAX requests that happen once the session has expired - certainly not what the AJAX call expects. Our desired way to handle this is server side - So, I have added a filter to this security filter chain that intercepts the request, checks to see if it is AJAX, and is attempting to respond with a redirect response that gets the user to the timeout page. Everything seems to be working with the exception of the client interpretation of the redirect.

The problem is in the next line

tempResult = eval(’(’ + configLoader.xmlDoc.responseText + ‘)’);

it assumes that server side will be a json string, but in your case it is an xml string, so it throws an error when parsed as json ( eval command )

thank you - just losing my mind on this one. Document.location= ‘url’ make things much happier!