Exemplo n.º 1
0
  @Override
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    HttpSession session = request.getSession();
    EasyDelegate del = (EasyDelegate) session.getAttribute(Constantes.DELEGATE);

    Integer mapid = SigarUtils.parseInt(request.getParameter("mapid"));
    if (mapid == null) mapid = (Integer) request.getAttribute("mapid");

    Integer hsId = SigarUtils.parseInt(request.getParameter("hsId"));
    if (hsId != null) {
      request.setAttribute("hsId", hsId);
      Hotspot h = del.getHotspot(hsId);
      Layer la = del.getLayer(h.getHsLayer());
      mapid = la.getMapId();
    } else {
      NewHotspotForm.setNewHsStatus(request, 6);
    }

    Map m = del.getMap(mapid);
    Project p = del.getProject(m.getProjectId());

    request.setAttribute("mapid", mapid);
    request.setAttribute("map", m);
    request.setAttribute("project", p);

    return mapping.findForward("add_new_text");
  }