protected ModelAndView doHandle()

in server/src/jetbrains/buildServer/agentsDiff/BuildAgentsDiffViewController.java [48:66]


  protected ModelAndView doHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response) throws Exception {
    final ModelAndView view = new ModelAndView(myPluginDescriptor.getPluginResourcesPath("agentsDiffView.jsp"));
    BuildAgentsDiffBean diff = BuildAgentsDiffBean.empty();
    String diffPermalink = "";

    final String agentAId = request.getParameter("agentA");
    final String agentBId = request.getParameter("agentB");

    final AgentDescription agentA = getAgentDescription(agentAId);
    final AgentDescription agentB = getAgentDescription(agentBId);
    if (agentA != null && agentB != null) {
      diff = myDiffCalculator.calculateDiff(agentA, agentB);
      diffPermalink = BuildAgentsDiffUtils.getDiffPermalink(agentAId, agentBId);
    }

    view.getModel().put("diff", diff);
    view.getModel().put("diffPermalink", diffPermalink);
    return view;
  }