//Dao层
package com.bear.cakeonline.test;
}
//service层
package com.bear.cakeonline.test;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional(readOnly=false)
public class TestServiceImpl {
@Resource
private TestDaoImpl testDaoImpl;
public void regist(){
this.testDaoImpl.saveUser();
}
}
//controller层
package com.bear.cakeonline.test;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/test")
public class TestController {
@Resource
private TestServiceImpl testServiceImpl;
@RequestMapping("/regist")
public String regist(){
System.out.println("lskdfj");
this.testServiceImpl.regist();
return "";
}
}