Ejemplo n.º 1
0
  @RequestMapping(value = "/getemail") // add post when deployed
  public @ResponseBody String getEmail(HttpSession session) throws JSONException {
    String type = (String) session.getAttribute("type");
    if (type != null) {
      int id = (Integer) session.getAttribute("id");
      return userService.getUser(id, type).email;
    }

    return "";
  }
Ejemplo n.º 2
0
 @RequestMapping(value = "/dash")
 public String dash(HttpSession session, ModelMap model) throws JSONException {
   String type = (String) session.getAttribute("type");
   if (type == null) {
     return "timeout";
   }
   Integer id = (Integer) session.getAttribute("id");
   User user = userService.getUser(id, type);
   model.addAttribute("email", user.email);
   if (type.equals("company")) {
     return "forward:/empd";
   } else {
     return "forward:/apyd";
   }
 }