SpringMVC中Controller的方法調用


同一個Controller下

  @RequestMapping("/add")
    public String add( Major major) {
        boolean result = majorIBaseService.add(major);
        if (result) {
            // 添加成功跳轉展示Page
            return new String("redirect:selectListPage") ;
        } else {
            // 添加失敗,回到添加方法
            return new String("redirect:addPage");
        }
    }
// 添加成功
  @RequestMapping("/selectListPage")
    public String selectListPage(Model model)  {
        // 獲取到所有的院系,發送到頁面,
        // do something...
    }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM