Load content into div with Jquery and spring returns 400 bad request message
I am puzzled, I have a call with jQuery using .load to fill a DIV with content composed of transformed XML into HTML, but whenever I call load (or $.get or $.ajax for that matter) I get a "400 Bad Request - The request sent by the client was syntactically incorrect" message.

The parameters are all there and even when I set up a test call for a page with no parameters I get the same message.  All this is being done via Spring (v3) with an annotated controller.  What's confusing is that I already have a portion of this working with calls to a web service that return a JSON object to fill a SELECT and that works fine.

How do I fill the DIV with HTML?

Javascript jQuery call:

            function doSearch()
            {
               var sUrl = "query.html";
               var sSecurityToken = '?st=' + $('#ihSecurityToken').val();
               
               var sProjects = '';
               $("#sltProjects option:selected").each(function () 
                  {
                     sProjects += $(this).val() + ';';
                  });
               sProjects = '&pn=' + escape(sProjects);
               
               var sDatabases = '';
               $("#sltDatabases option:selected").each(function () 
                  {
                     sDatabases += $(this).val() + ';';
                  });
               sDatabases = '&db=' + escape(sDatabases);
               
               var sQueryText = '&qt=' + escape($('#taSearchText').val());
               
               sSort = '&sr=' + $('#sltSort').val();
               sResultsPerPage = '&rp=' + $('#sltResultsPerPage').val();
               sRelevance = '&rl=' + $('#sltRelevance').val();
               
               var sFilters = '&ft=';
               var sTemp = '';
               $("[id^=fld]").each( function() 
                  {
                     sName = $(this).attr('alt');
                     sValue = escape($(this).val());
                     sTemp += escape((sName + '=' + sValue + ';'));
                  });

               if (sTemp.length)
               {
                  sFilters += sTemp;
               }
               else
               {
                  sFilters = '';
               }
               
               var sStartingPage = "&sp=1";
               
               
               sFinal = sUrl + sSecurityToken + sProjects + sDatabases + sQueryText + sSort + sResultsPerPage + sRelevance + sFilters + sStartingPage;
               $('#resultsBlock').load(sFinal);
    }

Controller code:

       @RequestMapping(value = "/query.html", method = RequestMethod.GET)
       public String doSearch(@RequestParam(value="st", required=true) String psSecurityToken,
             @RequestParam(value="pn", required=true) String psProjects,
             @RequestParam(value="db", required=true) String psDatabases,
             @RequestParam(value="qt", required=true) String psQueryText,
             @RequestParam(value="sr", required=true) String psSort,
             @RequestParam(value="rp", required=true) String psResultsPerPage,
             @RequestParam(value="rl", required=true) String psRelevance,
             @RequestParam(value="sp", required=true) String psStartingPage,
             @RequestParam(value="ft", required=false) String psFilters)
       {
          String sReturn = "";
          
          String sOptions = "";
          String sStartingPage = "1";
          if (!psStartingPage.isEmpty())
          {
             sStartingPage = psStartingPage;
          }
          
          String sSort = "Sort=" + psSort;
          String sResultsPerPage = "ResultsStart=" + sStartingPage + ";ResultsEnd=" +     psResultsPerPage;
          String sDatabases = "Repositories=" + psDatabases.replace(';', ',');
          String sRelevance = "RelevanceMin=" + psRelevance;
          String sDefaults =     "Print=All;SummaryType=Context;Highlighting=Terms+SummaryTerms;";
          sOptions = sSort + ";" + sResultsPerPage + ";" + sDatabases + ";" + sRelevance + ";" + sDefaults;

          sReturn = this.dgWebService.executeTextQuery(psSecurityToken, psProjects,     psDatabases, psQueryText, sOptions, psFilters);

          return sReturn;
       }

URL:

    http://localhost:8085/EnterpriseSearch/query.html?st=kjahsdf9845hasfha9348uwhefas&pn=ECC%3B&db=dbECC%3B&qt=money&sr=relevance&rp=10&rl=90&sp=1&ft=false

Firebug info:

    Response Headersview source
    Server	Apache-Coyote/1.1
    Content-Type	text/html;charset=utf-8
    Content-Length	971
    Date	Thu, 03 Nov 2011 20:06:56 GMT
    Connection	close
    Request Headersview source
    Host	localhost:8085
    User-Agent	Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.23) Gecko/20110920             Firefox/3.6.23
    Accept	text/html, */*; q=0.01
    Accept-Language	en-us,en;q=0.5
    Accept-Encoding	gzip,deflate
    Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive	115
    Connection	keep-alive
    X-Requested-With	XMLHttpRequest
    Referer	http://localhost:8085/EnterpriseSearch/search.html?username=lymana
    Cookie	JSESSIONID=CC30B029E8C9215489D4F938A6C1BB9D

Any ideas?  What am I missing?
Load content into div with Jquery and spring returns 400 bad request message
===

I am puzzled, I have a call with jQuery using .load to fill a DIV with content composed of transformed XML into HTML, but whenever I call load (or $.get or $.ajax for that matter) I get a "400 Bad Request - The request sent by the client was syntactically incorrect" message.

The parameters are all there and even when I set up a test call for a page with no parameters I get the same message.  All this is being done via Spring (v3) with an annotated controller.  What's confusing is that I already have a portion of this working with calls to a web service that return a JSON object to fill a SELECT and that works fine.

How do I fill the DIV with HTML?

Javascript jQuery call:

            function doSearch()
            {
               var sUrl = "query.html";
               var sSecurityToken = '?st=' + $('#ihSecurityToken').val();
               
               var sProjects = '';
               $("#sltProjects option:selected").each(function () 
                  {
                     sProjects += $(this).val() + ';';
                  });
               sProjects = '&pn=' + escape(sProjects);
               
               var sDatabases = '';
               $("#sltDatabases option:selected").each(function () 
                  {
                     sDatabases += $(this).val() + ';';
                  });
               sDatabases = '&db=' + escape(sDatabases);
               
               var sQueryText = '&qt=' + escape($('#taSearchText').val());
               
               sSort = '&sr=' + $('#sltSort').val();
               sResultsPerPage = '&rp=' + $('#sltResultsPerPage').val();
               sRelevance = '&rl=' + $('#sltRelevance').val();
               
               var sFilters = '&ft=';
               var sTemp = '';
               $("[id^=fld]").each( function() 
                  {
                     sName = $(this).attr('alt');
                     sValue = escape($(this).val());
                     sTemp += escape((sName + '=' + sValue + ';'));
                  });

               if (sTemp.length)
               {
                  sFilters += sTemp;
               }
               else
               {
                  sFilters = '';
               }
               
               var sStartingPage = "&sp=1";
               
               
               sFinal = sUrl + sSecurityToken + sProjects + sDatabases + sQueryText + sSort + sResultsPerPage + sRelevance + sFilters + sStartingPage;
               $('#resultsBlock').load(sFinal);
    }

Controller code:

       @RequestMapping(value = "/query.html", method = RequestMethod.GET)
       public String doSearch(@RequestParam(value="st", required=true) String psSecurityToken,
             @RequestParam(value="pn", required=true) String psProjects,
             @RequestParam(value="db", required=true) String psDatabases,
             @RequestParam(value="qt", required=true) String psQueryText,
             @RequestParam(value="sr", required=true) String psSort,
             @RequestParam(value="rp", required=true) String psResultsPerPage,
             @RequestParam(value="rl", required=true) String psRelevance,
             @RequestParam(value="sp", required=true) String psStartingPage,
             @RequestParam(value="ft", required=false) String psFilters)
       {
          String sReturn = "";
          
          String sOptions = "";
          String sStartingPage = "1";
          if (!psStartingPage.isEmpty())
          {
             sStartingPage = psStartingPage;
          }
          
          String sSort = "Sort=" + psSort;
          String sResultsPerPage = "ResultsStart=" + sStartingPage + ";ResultsEnd=" +     psResultsPerPage;
          String sDatabases = "Repositories=" + psDatabases.replace(';', ',');
          String sRelevance = "RelevanceMin=" + psRelevance;
          String sDefaults =     "Print=All;SummaryType=Context;Highlighting=Terms+SummaryTerms;";
          sOptions = sSort + ";" + sResultsPerPage + ";" + sDatabases + ";" + sRelevance + ";" + sDefaults;

          sReturn = this.dgWebService.executeTextQuery(psSecurityToken, psProjects,     psDatabases, psQueryText, sOptions, psFilters);

          return sReturn;
       }

URL:

    http://localhost:8085/EnterpriseSearch/query.html?st=kjahsdf9845hasfha9348uwhefas&pn=ECC%3B&db=dbECC%3B&qt=money&sr=relevance&rp=10&rl=90&sp=1&ft=false

Firebug info:

    Response Headersview source
    Server	Apache-Coyote/1.1
    Content-Type	text/html;charset=utf-8
    Content-Length	971
    Date	Thu, 03 Nov 2011 20:06:56 GMT
    Connection	close
    Request Headersview source
    Host	localhost:8085
    User-Agent	Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.23) Gecko/20110920             Firefox/3.6.23
    Accept	text/html, */*; q=0.01
    Accept-Language	en-us,en;q=0.5
    Accept-Encoding	gzip,deflate
    Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive	115
    Connection	keep-alive
    X-Requested-With	XMLHttpRequest
    Referer	http://localhost:8085/EnterpriseSearch/search.html?username=lymana
    Cookie	JSESSIONID=CC30B029E8C9215489D4F938A6C1BB9D

Any ideas?  What am I missing?