Changeset 4419


Ignore:
Timestamp:
Feb 21, 2013, 3:29:15 PM (10 years ago)
Author:
olle
Message:

Refs #797. Regular update of the job table via Ajax updated to not interfere with actions on the "Jobs" web page, that do not set a forward action, but rely on being returned to action ListJobs as the last action:

  1. JavaScript? www/static/js/script.js in client/servlet/ updated in function updateJobTableColumns() to add a parameter cmd to the Ajax request, and set its value to "updateJobTable".
  2. Class/file action/job/ListJobsAjax.java in client/servlet/ updated to identify a proper Ajax request by requiring that parameter cmd has value "updateJobTable", and otherwise forward the request to action ListJobs.class.


Location:
trunk/client/servlet
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/action/job/ListJobsAjax.java

    r4417 r4419  
    105105          log.debug("doGet(): cmd = \"" + cmd + "\"");
    106106          log.debug("doGet(): jobIdList = \"" + jobIdListStr + "\"");
     107          if (cmd == null || !cmd.equals("updateJobTable"))
     108          {
     109            // Request not intended for this servlet, forward to ListJobs
     110            setForwardTo(ListJobs.class);
     111            return;
     112          }
    107113          resp.setContentType("application/json");
    108114          //resp.setCharacterEncoding("UTF-8");
  • trunk/client/servlet/www/static/js/script.js

    r4410 r4419  
    438438function updateJobTableColumns()
    439439{
     440  // Set cmd so Ajax application can verify that the request was not intended for other servlet
     441  var cmd = 'updateJobTable';
    440442  // Get job id values in comma-separated list
    441443  var jobIdList = getJobIdList();
    442   var url = 'app?action=org.proteios.action.job.ListJobsAjax&jobIdList=' + jobIdList;
     444  var url = 'app?action=org.proteios.action.job.ListJobsAjax&cmd=' + cmd + '&jobIdList=' + jobIdList;
    443445  var request = new XMLHttpRequest();
    444446  request.open("GET", url, false);
Note: See TracChangeset for help on using the changeset viewer.