package com.controller.mysql;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.pojo.po.Student;
import com.service.IStudentService;
@Controller
@RequestMapping("/student/")
public class StudentController {
@Resource
private IStudentService studentService;
@RequestMapping(value = "get", method = RequestMethod.POST)
public String get(@RequestParam Integer id, Model model) {
Student student = studentService.get(id);
model.addAttribute("student", student);
return "student";
}
@RequestMapping(value = "add", method = RequestMethod.POST)
public String add(Student student, Model model) {
int id = studentService.add(student);
model.addAttribute("id", id);
return "student";
}
@RequestMapping(value = "delete", method = RequestMethod.POST)
public String delete(@RequestParam Integer id, Model model) {
studentService.delete(id);
model.addAttribute("delFlag", true);
return "student";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
dynamicDatasourceDemo.rar (98个子文件)
dynamicDatasourceDemo
.settings
com.genuitec.eclipse.j2eedt.core.prefs 1KB
org.eclipse.ltk.core.refactoring.prefs 137B
org.eclipse.core.resources.prefs 176B
org.eclipse.jdt.core.prefs 330B
src
com
core
DatabaseContextHolder.java 406B
DataSourceInterceptor.java 333B
DynamicDataSource.java 290B
dao
IStudentDao.java 166B
impl
StudentDaoImpl.java 716B
UserDaoImpl.java 696B
IUserDao.java 184B
pojo
po
User.java 826B
Student.java 839B
vo
resources
validation_en_US.properties 0B
springConfig-core.xml 7KB
spring-mvc.xml 3KB
datasource.properties 904B
log4j.properties 616B
validation_zh_CN.properties 0B
ehcache.xml 3KB
hibernate.cfg.xml 1KB
controller
oracle
UserController.java 1KB
mysql
StudentController.java 1KB
service
IUserService.java 192B
IStudentService.java 174B
impl
UserServiceImpl.java 538B
StudentServiceImpl.java 543B
.checkstyle 310B
.project 1KB
WebRoot
META-INF
MANIFEST.MF 36B
WEB-INF
web.xml 3KB
classes
com
core
DataSourceInterceptor.class 702B
DatabaseContextHolder.class 976B
DynamicDataSource.class 544B
dao
IUserDao.class 284B
IStudentDao.class 217B
impl
StudentDaoImpl.class 1KB
UserDaoImpl.class 1KB
pojo
po
User.class 1KB
Student.class 1KB
vo
resources
validation_en_US.properties 0B
springConfig-core.xml 7KB
spring-mvc.xml 3KB
datasource.properties 904B
log4j.properties 616B
validation_zh_CN.properties 0B
ehcache.xml 3KB
hibernate.cfg.xml 1KB
controller
oracle
UserController.class 2KB
mysql
StudentController.class 2KB
service
IStudentService.class 229B
IUserService.class 296B
impl
StudentServiceImpl.class 943B
UserServiceImpl.class 969B
lib
hibernate-jpa-2.1-api-1.0.0.Final.jar 111KB
spring-core-4.1.4.RELEASE.jar 983KB
validation-api-1.1.0.Final.jar 62KB
dom4j-1.6.1.jar 307KB
spring-context-4.1.4.RELEASE.jar 1002KB
hibernate-core-4.3.8.Final.jar 5.03MB
mysql-connector-java-5.1.30-bin.jar 932KB
spring-jdbc-4.1.4.RELEASE.jar 417KB
aopalliance-1.0.jar 4KB
antlr-2.7.7.jar 435KB
spring-test-4.1.4.RELEASE.jar 491KB
spring-beans-4.1.4.RELEASE.jar 692KB
spring-aspects-4.1.4.RELEASE.jar 56KB
spring-expression-4.1.4.RELEASE.jar 253KB
spring-webmvc-portlet-4.1.4.RELEASE.jar 173KB
slf4j-api-1.6.1.jar 25KB
spring-web-4.1.4.RELEASE.jar 698KB
ojdbc6.jar 1.9MB
jboss-logging-annotations-1.2.0.Beta1.jar 11KB
jandex-1.1.0.Final.jar 75KB
spring-orm-4.1.4.RELEASE.jar 367KB
jboss-logging-3.1.3.GA.jar 56KB
javassist-3.18.1-GA.jar 697KB
hibernate-ehcache-4.3.8.Final.jar 132KB
commons-logging-1.1.3.jar 61KB
spring-webmvc-4.1.4.RELEASE.jar 763KB
ehcache-core-2.6.10.jar 1.29MB
spring-context-support-4.1.4.RELEASE.jar 174KB
classmate-1.0.0.jar 59KB
hibernate-commons-annotations-4.0.5.Final.jar 74KB
jboss-transaction-api_1.2_spec-1.0.0.Final.jar 27KB
c3p0-0.9.5.jar 477KB
spring-aop-4.1.4.RELEASE.jar 351KB
mchange-commons-java-0.2.8.jar 589KB
log4j-1.2.17.jar 478KB
aspectjweaver-1.7.3.jar 1.74MB
spring-tx-4.1.4.RELEASE.jar 247KB
hibernate-validator-5.1.3.Final.jar 619KB
hibernate-validator-annotation-processor-5.1.3.Final.jar 63KB
index.jsp 890B
jsp
student.jsp 3KB
user.jsp 3KB
.mymetadata 337B
.classpath 4KB
.myeclipse
共 98 条
- 1
wangpeng047
- 粉丝: 1955
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页