title: want to add to my full calendar the holiday details
body: <p>I have implemented the fullCalendar and the events are getting displayed too from the database. 
  I want to do the same for another holidays table.
  Im posting my code here.</p>
  
  <pre><code>package net.admin.module.view;
  import java.text.DateFormat;
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.List;
  import javax.servlet.http.HttpServletRequest;
  import org.apache.struts2.ServletActionContext;
  import org.json.JSONArray;
  import org.json.JSONObject;
  import net.admin.module.controller.EventManager;
  import net.admin.module.controller.HolidaysManager;
  import net.admin.module.model.Event;
  import net.admin.module.model.Holidays;
  import com.opensymphony.xwork2.ActionSupport;
  public class EventAction extends ActionSupport {
      private static final long serialVersionUID = 9149826260758390091L;
      private Event event;
      private List&lt;Event&gt; eventList;
      private int id;
      private Holidays holidays;
      private List&lt;Holidays&gt; holidaysList;
      private HolidaysManager holidaysManager;
      private EventManager eventManager;
      public EventAction() {
          eventManager = new EventManager();
      }
      public String execute() {
          this.eventList = eventManager.list();
          System.out.println("execute called");
          return SUCCESS;
      }
  
      public String eventAjax() {
          this.eventList = eventManager.list();
         // this.holidaysList = holidaysManager.list();
          HttpServletRequest request = ServletActionContext.getRequest();
          JSONObject json = new JSONObject();
          JSONArray jArr = new JSONArray();
  
          try{
              JSONObject jObject = null;
              Event event = null;
              for(int i = 0; i &lt; eventList.size(); i++) {
                  event = eventList.get(i);
                  jObject=new JSONObject();
                  jObject.put("title", event.getName());
                  jObject.put("start", event.getDate());
                  jObject.put("allDay", true);
              //  jObject.put("end", event.getDate());
                  jArr.put(jObject);
              }
              json.put("eventdata", jArr);
              request.setAttribute("json", jArr);
          }
          catch(Exception e){
              e.printStackTrace();
          }
          return "json";
      }
  
      public String addEvent() {
          System.out.println(getEvent());
          try {
              Event eve = getEvent();
              DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
              try {
                  eve.setDate(df.parse(eve.getDateStr()));
              } catch (ParseException e) {
                  e.printStackTrace();
              }
              eventManager.addEvent(eve);
          } catch (Exception e) {
              e.printStackTrace();
          }
          return SUCCESS;
      }
      public String delete() {
          eventManager.deleteEvent(getId());
          return SUCCESS;
      }
      public Event getEvent() {
          return event;
      }
      public List&lt;Event&gt; getEventList() {
          return eventList;
      }
      public void setEvent(Event event) {
          this.event = event;
      }
      public void setEventList(List&lt;Event&gt; eventList) {
          this.eventList = eventList;
      }
      public int getId() {
          return id;
      }
      public void setId(int id) {
          this.id = id;
      }
      public Holidays getHolidays() {
          return holidays;
      }
      public List&lt;Holidays&gt; getHolidaysList() {
          return holidaysList;
      }
      public void setHolidays(Holidays holidays) {
          this.holidays = holidays;
      }
      public void setHolidaysList(List&lt;Holidays&gt; holidaysList) {
          this.holidaysList = holidaysList;
      }
      public HolidaysManager getHolidaysManager() {
          return holidaysManager;
      }
      public void setHolidaysManager(HolidaysManager holidaysManager) {
          this.holidaysManager = holidaysManager;
      }
  } 
  </code></pre>
  
  <p>This is my action class.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;link href='css/fullcalendar.css' rel='stylesheet' /&gt;
  &lt;link href='css/fullcalendar.print.css' rel='stylesheet' media='print' /&gt;
  &lt;script src='js/jquery.min.js'&gt;&lt;/script&gt;
  &lt;script src='js/jquery-ui.custom.min.js'&gt;&lt;/script&gt;
  &lt;script src='js/fullcalendar.min.js'&gt;&lt;/script&gt;
  &lt;link href="jquery-ui-1.10.0.custom.css" rel="stylesheet" type="text/css" media = "all"/&gt;
  &lt;link rel='stylesheet' type='text/css' href='cssdata/fullcalendar.css' /&gt;
  &lt;script src="js/jquery-1.9.0.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery-ui-1.10.0.custom.min.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src='js/fullcalendar.js'&gt;&lt;/script&gt;
  &lt;pre&gt;
  &lt;script&gt;
  var eventData = [];
  $(document).ready(function() {
  
          //getEvents();
          var date = new Date();
          var d = date.getDate();
          var m = date.getMonth();
          var y = date.getFullYear();
          $('#calendar').fullCalendar({
              header: {
                  left: 'prev,next today',
                  center: 'title',
                  right: 'month,basicWeek,basicDay'
              },
              editable: true,
              events: function(start, end, callback) {
                  $.ajax({
                      url: 'eventAjax.action',
                      dataType: 'json',
                      data: {
                          // our hypothetical feed requires UNIX timestamps
                          start: Math.round(start.getTime() / 1000),
                          end: Math.round(end.getTime() / 1000)
                      },
                      success: function(doc) {
                          var events = [];
                          $(doc).each(function() {
                              events.push({
                                  title: $(this).attr('title'),
                                  start: $(this).attr('start') // will be parsed
                              });
                          });
                          callback(events);
                      }
                  });
              } 
          });
  
      });
  
      /* function getEvents(){
          $.post("eventAjax.action", {},
            function(data){
              eventData=data;
              alert(eventData);
          });
      } */                
  &lt;/script&gt;
  &lt;style&gt;
      body {
          margin-top: 40px;
          text-align: center;
          font-size: 14px;
          font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
          }
  
      #calendar {
          width: 900px;
          margin: 0 auto;
          }
  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id='calendar'&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is my jsp.
  The calendar shows all the events that are present in tha database as of now. I want to do the same with my holiday table.</p>