title: Reload struts2 action embedded in JSP
body: <p>Ok, I will try to make this as short and easy to follow as possible.  </p>
  
  <p>I am using a JQuery Full Calendar and displaying events to a user.  I have a Filter action on the page that allows the user to filter the events that display based upon different criteria.  One of those criteria is the Event Name.  The ultimate goal is to get the filter to reload the selectable 'Event Name' options from the Full Calendar View.  </p>
  
  <p>I have this all working, but it's out of sync.  </p>
  
  <p>My JSP to include the filter is like this:</p>
  
  <pre><code>&lt;div id="popUpFilterInfo" class="filterPopUp"&gt;      
  &lt;s:action name="ScheduleFilter" executeResult="true" id="scheduleFilter"&gt;&lt;/s:action&gt;        
  &lt;/div&gt;
  </code></pre>
  
  <p>This returns another JSP page which includes the Filter Form.  The Struts is run at page render time, so this filter is built before the view is built. This filter is then hidden/shown with jQuery when a user selects a button.  </p>
  
  <p>The Page Action is different from the Filter Action as this Filter Action will need to be included within multiple pages </p>
  
  <p>After the Full Calendar Loads, it sends its dates back to the page action which stores those dates into a filter object in a global context for the Application.</p>
  
  <p>The problem that I'm running into is that I cannot get the page to reload just the filter when the view changes.  If i reload the whole page, then the filter does contain the data from the previous view, so I know that I just need to tell the page to re-render the ScheduleFilter form.  I tried to do this with jQuery as so:</p>
  
  <pre><code>var filter = "&lt;s:action name=\"ScheduleFilter\" executeResult=\"true\" id=\"scheduleFilter\"&gt;&lt;/s:action&gt;";
  jQuery('#popUpFilterInfo').children().remove();
  jQuery('#popUpFilterInfo').append(filter);  
  </code></pre>
  
  <p>This throws a JasperException saying 'quote symbol expected' on the line where the filter Variable is being instantiated. right in the middle of 'name' specifying character 'm' is the problem.   </p>
  
  <p>Does anyone know how to reload an embedded action like this without reloading the whole page?   </p>
  
  <p><strong>ANSWER</strong>:</p>
  
  <p>As Dave said below, don't embed the action with the <code>&lt;s:action&gt;</code> tag.  I switched this and instead am calling the action with Ajax and upon success, then I use jQuery to insert the returned data into my Filter form div.  I put in a check to see if the div is empty or not, and clear the div if it already has a filter in it.  An example is below</p>
  
  <p>My filter div:</p>
  
  <pre><code>&lt;div id="popUpFilterInfo" class="filterPopUp"&gt;&lt;/div&gt; 
  </code></pre>
  
  <p>Action call:</p>
  
  <pre><code>function loadFilter() {
      if(!jQuery('#popUpFilterInfo').is(':empty')){
          jQuery('#popUpFilterInfo').children().remove();         
      }
      jQuery.ajax({
          url:'Filter.action',
          data:"",
          dataType: "",
          type: "GET",
          success: function(filter) {
              jQuery('#popUpFilterInfo').append(filter); 
          }
      });
  }
  </code></pre>