简单的Spring Web工程跳转且传参Demo(2)

package com.dzpykj.jump; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.dzpykj.jump.service.ITestService; @Controller @RequestMapping("/test") public class TestController { @Autowired ITestService testService; @RequestMapping("/jump") public ModelAndView jump( String name){ ModelAndView mav = new ModelAndView(); mav.setViewName("test"); mav.addObject("name",name); return mav; } } 

org.eclipse.wst.common.component

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/4347b62dd6da7e01aff103814eaebfd8.html