posts - 59, comments - 244, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

spring mvc注解例子

Posted on 2010-11-28 01:37 penngo 阅读(130654) 评论(55)  编辑  收藏 所属分类: Java
 弃用了struts,用spring mvc框架做了几个项目,感觉都不错,而且使用了注解方式,可以省掉一大堆配置文件。本文主要介绍使用注解方式配置的spring mvc,之前写的spring3.0 mvc和rest小例子没有介绍到数据层的内容,现在这一篇补上。下面开始贴代码。

文中用的框架版本:spring 3,hibernate 3,没有的,自己上网下。

web.xml配置:

<?xml version="1.0" encoding="UTF-8"?>   
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">   
  
<display-name>s3h3</display-name>   
   
<context-param>     
     
<param-name>contextConfigLocation</param-name>     
     
<param-value>classpath:applicationContext*.xml</param-value>     
 
</context-param>     
  
<listener>     
     
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>     
 
</listener>     
  
 
<servlet>     
     
<servlet-name>spring</servlet-name>     
     
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>     
     
<load-on-startup>1</load-on-startup>     
 
</servlet>     
 
<servlet-mapping>     
     
<servlet-name>spring</servlet-name>  <!-- 这里在配成spring,下边也要写一个名为spring-servlet.xml的文件,主要用来配置它的controller -->   
     
<url-pattern>*.do</url-pattern>     
 
</servlet-mapping>     
  
<welcome-file-list>   
    
<welcome-file>index.jsp</welcome-file>   
  
</welcome-file-list>   
</web-app>  

spring-servlet,主要配置controller的信息

<?xml version="1.0" encoding="UTF-8"?>   
  
<beans xmlns="http://www.springframework.org/schema/beans"     
       xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"     
        xmlns:context
="http://www.springframework.org/schema/context"     
   xsi:schemaLocation
="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd   
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd   
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd   
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
>   
     
  
<context:annotation-config />   
       
<!-- 把标记了@Controller注解的类转换为bean -->     
      
<context:component-scan base-package="com.mvc.controller" />     
  
<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 -->     
      
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />     
        
       
<!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->     
       
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"     
          p:prefix
="/WEB-INF/view/" p:suffix=".jsp" />     
           
       
<bean id="multipartResolver"     
          class
="org.springframework.web.multipart.commons.CommonsMultipartResolver"     
          p:defaultEncoding
="utf-8" />     
 
</beans>  

applicationContext.xml代码

<?xml version="1.0" encoding="UTF-8"?>   
<beans xmlns="http://www.springframework.org/schema/beans"  
 xmlns:aop
="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"  
 xmlns:p
="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"  
 xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"  
 xsi:schemaLocation
="   
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd   
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd   
   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd   
   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
>   
  
 
<context:annotation-config />   
 
<context:component-scan base-package="com.mvc" />  <!-- 自动扫描所有注解该路径 -->   
  
 
<context:property-placeholder location="classpath:/hibernate.properties" />   
  
 
<bean id="sessionFactory"  
  class
="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">   
  
<property name="dataSource" ref="dataSource" />   
  
<property name="hibernateProperties">   
   
<props>   
    
<prop key="hibernate.dialect">${dataSource.dialect}</prop>   
    
<prop key="hibernate.hbm2ddl.auto">${dataSource.hbm2ddl.auto}</prop>   
    
<prop key="hibernate.hbm2ddl.auto">update</prop>   
   
</props>   
  
</property>   
  
<property name="packagesToScan">   
   
<list>   
    
<value>com.mvc.entity</value><!-- 扫描实体类,也就是平时所说的model -->   
   
</list>   
    
</property>   
 
</bean>   
  
 
<bean id="transactionManager"  
  class
="org.springframework.orm.hibernate3.HibernateTransactionManager">   
  
<property name="sessionFactory" ref="sessionFactory" />   
  
<property name="dataSource" ref="dataSource" />   
 
</bean>   
  
 
<bean id="dataSource"  
  class
="org.springframework.jdbc.datasource.DriverManagerDataSource">   
  
<property name="driverClassName" value="${dataSource.driverClassName}" />   
  
<property name="url" value="${dataSource.url}" />   
  
<property name="username" value="${dataSource.username}" />   
  
<property name="password" value="${dataSource.password}" />   
 
</bean>   
 
<!-- Dao的实现 -->   
 
<bean id="entityDao" class="com.mvc.dao.EntityDaoImpl">     
  
<property name="sessionFactory" ref="sessionFactory" />   
 
</bean>   
 
<tx:annotation-driven transaction-manager="transactionManager" />   
 
<tx:annotation-driven mode="aspectj"/>   
     
    
<aop:aspectj-autoproxy/>     
</beans>  

hibernate.properties数据库连接配置

dataSource.password=123  
dataSource.username=root   
dataSource.databaseName=test   
dataSource.driverClassName=com.mysql.jdbc.Driver   
dataSource.dialect=org.hibernate.dialect.MySQL5Dialect   
dataSource.serverName=localhost:3306  
dataSource.url=jdbc:mysql://localhost:3306/test   
dataSource.properties=user=${dataSource.username};databaseName=${dataSource.databaseName};serverName=${dataSource.serverName};password=${dataSource.password}   
dataSource.hbm2ddl.auto=update  

配置已经完成,下面开始例子
先在数据库建表,例子用的是mysql数据库

CREATE TABLE  `test`.`student` (   
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,   
  `name` varchar(45) NOT NULL,   
  `psw` varchar(45) NOT NULL,   
  PRIMARY KEY (`id`)   
)  

建好表后,生成实体类

package com.mvc.entity;   
  
import java.io.Serializable;   
  
import javax.persistence.Basic;   
import javax.persistence.Column;   
import javax.persistence.Entity;   
import javax.persistence.GeneratedValue;   
import javax.persistence.GenerationType;   
import javax.persistence.Id;   
import javax.persistence.Table;   
  
@Entity  
@Table(name = "student")   
public class Student implements Serializable {   
    private static final long serialVersionUID = 1L;   
    @Id  
    @Basic(optional = false)   
    @GeneratedValue(strategy = GenerationType.IDENTITY)   
    @Column(name = "id", nullable = false)   
    private Integer id;   
    @Column(name = "name")   
    private String user;   
    @Column(name = "psw")   
    private String psw;   
    public Integer getId() {   
        return id;   
    }   
    public void setId(Integer id) {   
        this.id = id;   
    }   
       
    public String getUser() {   
        return user;   
    }   
    public void setUser(String user) {   
        this.user = user;   
    }   
    public String getPsw() {   
        return psw;   
    }   
    public void setPsw(String psw) {   
        this.psw = psw;   
    }   
}  

Dao层实现
package com.mvc.dao;   
  
import java.util.List;   
  
public interface EntityDao {   
    
public List<Object> createQuery(final String queryString);   
    
public Object save(final Object model);   
    
public void update(final Object model);   
    
public void delete(final Object model);   
}
  

package com.mvc.dao;   
  
import java.util.List;   
  
import org.hibernate.Query;   
import org.springframework.orm.hibernate3.HibernateCallback;   
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;   
  
public class EntityDaoImpl extends HibernateDaoSupport implements EntityDao{   
    
public List<Object> createQuery(final String queryString) {   
        
return (List<Object>) getHibernateTemplate().execute(   
                
new HibernateCallback<Object>() {   
                    
public Object doInHibernate(org.hibernate.Session session)   
                            
throws org.hibernate.HibernateException {   
                        Query query 
= session.createQuery(queryString);   
                        List
<Object> rows = query.list();   
                        
return rows;   
                    }
   
                }
);   
    }
   
    
public Object save(final Object model) {   
        
return  getHibernateTemplate().execute(   
                
new HibernateCallback<Object>() {   
                    
public Object doInHibernate(org.hibernate.Session session)   
                            
throws org.hibernate.HibernateException {   
                        session.save(model);   
                        
return null;   
                    }
   
                }
);   
    }
   
    
public void update(final Object model) {   
        getHibernateTemplate().execute(
new HibernateCallback<Object>() {   
            
public Object doInHibernate(org.hibernate.Session session)   
                    
throws org.hibernate.HibernateException {   
                session.update(model);   
                
return null;   
            }
   
        }
);   
    }
   
    
public void delete(final Object model) {   
        getHibernateTemplate().execute(
new HibernateCallback<Object>() {   
            
public Object doInHibernate(org.hibernate.Session session)   
                    
throws org.hibernate.HibernateException {   
                session.delete(model);   
                
return null;   
            }
   
        }
);   
    }
   
}
  

Dao在applicationContext.xml注入
<bean id="entityDao" class="com.mvc.dao.EntityDaoImpl">  
  
<property name="sessionFactory" ref="sessionFactory" />
 
</bean>


Dao只有一个类的实现,直接供其它service层调用,如果你想更换为其它的Dao实现,也只需修改这里的配置就行了。
开始写view页面,WEB-INF/view下新建页面student.jsp,WEB-INF/view这路径是在spring-servlet.xml文件配置的,你可以配置成其它,也可以多个路径。student.jsp代码

<%@ page language="java" contentType="text/html; charset=UTF-8"  
    pageEncoding
="UTF-8"
%>  
<%@ include file="/include/head.jsp"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
<title>添加</title>  
<script language="javascript" src="<%=request.getContextPath()%><!--   
/script/jquery.min.js"
>  
// --></script>  
<style><!--   
table
{  border-collapse:collapse;  }   
td
{  border:1px solid #f00;  }   
--></style><style mce_bogus="1">table{  border-collapse:collapse;  }   
td
{  border:1px solid #f00;  }</style>  
<script type="text/javascript"><!--   
function add(){   
    window.location.href
="<%=request.getContextPath() %>/student.do?method=add";   
}
   
  
function del(id){   
$.ajax( 
{   
    type : 
"POST",   
    url : 
"<%=request.getContextPath()%>/student.do?method=del&id=" + id,   
    dataType: 
"json",   
    success : 
function(data) {   
        
if(data.del == "true"){   
            alert(
"删除成功!");   
            $(
"#" + id).remove();   
        }
   
        
else{   
            alert(
"删除失败!");   
        }
   
    }
,   
    error :
function(){   
        alert(
"网络连接出错!");   
    }
   
}
);   
}
   
// --></script>  
</head>  
<body>  
  
<input id="add" type="button" onclick="add()" value="添加"/>  
<table >  
    
<tr>  
        
<td>序号</td>  
        
<td>姓名</td>  
        
<td>密码</td>  
        
<td>操作</td>  
    
</tr>  
    
<c:forEach items="${list}" var="student">  
    
<tr id="<c:out value="${student.id}"/>">  
        
<td><c:out value="${student.id}"/></td>  
        
<td><c:out value="${student.user}"/></td>  
        
<td><c:out value="${student.psw}"/></td>  
        
<td>  
            
<input type="button" value="编辑"/>        
            
<input type="button" onclick="del('<c:out value="${student.id}"/>')" value="删除"/>  
        
</td>  
    
</tr>  
    
</c:forEach>  
       
</table>  
</body>  
</html>  

student_add.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"  
    pageEncoding
="UTF-8"
%>  
<%@ include file="/include/head.jsp"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
<title>学生添加</title>  
<mce:script type="text/javascript"><!--   
function turnback(){   
    window.location.href="<%=request.getContextPath() %>/student.do";   
}   
// 
--></mce:script>  
</head>  
<body>  
<form method="post" action="<%=request.getContextPath() %>/student.do?method=save">  
<div><c:out value="${addstate}"></c:out></div>  
<table>  
    
<tr><td>姓名</td><td><input id="user" name="user" type="text" /></td></tr>  
    
<tr><td>密码</td><td><input id="psw" name="psw"  type="text" /></td></tr>  
    
<tr><td colSpan="2" align="center"><input type="submit" value="提交"/><input type="button" onclick="turnback()" value="返回" /> </td></tr>  
</table>  
  
</form>  
</body>  
</html>  

controller类实现,只需把注解写上,spring就会自动帮你找到相应的bean,相应的注解标记意义,不明白的,可以自己查下@Service,@Controller,@Entity等等的内容。

package com.mvc.controller;   
  
import java.util.List;   
  
import javax.servlet.http.HttpServletRequest;   
import javax.servlet.http.HttpServletResponse;   
  
import org.apache.commons.logging.Log;   
import org.apache.commons.logging.LogFactory;   
import org.springframework.beans.factory.annotation.Autowired;   
import org.springframework.stereotype.Controller;   
import org.springframework.ui.ModelMap;   
import org.springframework.web.bind.annotation.RequestMapping;   
import org.springframework.web.bind.annotation.RequestMethod;   
import org.springframework.web.bind.annotation.RequestParam;   
import org.springframework.web.servlet.ModelAndView;   
  
import com.mvc.entity.Student;   
import com.mvc.service.StudentService;   
  
@Controller  
@RequestMapping(
"/student.do")   
public class StudentController {   
    
protected final transient Log log = LogFactory   
    .getLog(StudentController.
class);   
    @Autowired  
    
private StudentService studentService;   
    
public StudentController(){   
           
    }
   
       
    @RequestMapping  
    
public String load(ModelMap modelMap){   
        List
<Object> list = studentService.getStudentList();   
        modelMap.put(
"list", list);   
        
return "student";   
    }
   
       
    @RequestMapping(params 
= "method=add")   
    
public String add(HttpServletRequest request, ModelMap modelMap) throws Exception{   
        
return "student_add";   
    }
   
       
    @RequestMapping(params 
= "method=save")   
    
public String save(HttpServletRequest request, ModelMap modelMap){   
        String user 
= request.getParameter("user");   
        String psw 
= request.getParameter("psw");   
        Student st 
= new Student();   
        st.setUser(user);   
        st.setPsw(psw);   
        
try{   
            studentService.save(st);   
            modelMap.put(
"addstate""添加成功");   
        }
   
        
catch(Exception e){   
            log.error(e.getMessage());   
            modelMap.put(
"addstate""添加失败");   
        }
   
           
        
return "student_add";   
    }
   
       
    @RequestMapping(params 
= "method=del")   
    
public void del(@RequestParam("id") String id, HttpServletResponse response){   
        
try{   
            Student st 
= new Student();   
            st.setId(Integer.valueOf(id));   
            studentService.delete(st);   
            response.getWriter().print(
"{\"del\":\"true\"}");   
        }
   
        
catch(Exception e){   
            log.error(e.getMessage());   
            e.printStackTrace();   
        }
   
    }
   
}
  

service类实现

package com.mvc.service;   
  
import java.util.List;   
  
import org.springframework.beans.factory.annotation.Autowired;   
import org.springframework.stereotype.Service;   
import org.springframework.transaction.annotation.Transactional;   
  
import com.mvc.dao.EntityDao;   
import com.mvc.entity.Student;   
  
@Service  
public class StudentService {   
 @Autowired  
 
private EntityDao entityDao;   
    
 @Transactional  
 
public List<Object> getStudentList(){   
  StringBuffer sff 
= new StringBuffer();   
  sff.append(
"select a from ").append(Student.class.getSimpleName()).append(" a ");   
  List
<Object> list = entityDao.createQuery(sff.toString());   
  
return list;   
 }
   
    
 
public void save(Student st){   
  entityDao.save(st);   
 }
   
 
public void delete(Object obj){   
  entityDao.delete(obj);   
 }
   
}
 

OK,例子写完。有其它业务内容,只需直接新建view,并实现相应comtroller和service就行了,配置和dao层的内容基本不变,也就是每次只需写jsp(view),controller和service调用dao就行了。

怎样,看了这个,spring mvc是不是比ssh实现更方便灵活。


完整源码:srping mvc注解实现(在这篇文章的后面附件,这个是我另一个博客的地址)

评论

# re: spring mvc注解实现[未登录]  回复  更多评论   

2010-11-28 12:03 by hijackwust
您好,最后的源码链接无法下载。。

# re: spring mvc注解实现  回复  更多评论   

2010-11-28 13:22 by pengo
@hijackwust
地址已改过来了,需要学习的,自己下载。附件的代码是我在eclipse3.5下写的。

# re: spring mvc注解实现[未登录]  回复  更多评论   

2010-11-28 14:37 by hijackwust
MVC注解的国际化怎么弄?

# re: spring mvc注解实现[未登录]  回复  更多评论   

2010-11-28 14:51 by hijackwust
为什么我使用SpringMVC3时页面不支持EL表达式,而你的页面就可以?

还有 用MVC注解做验证时候的国际化,您是如何处理的?
最近我也在学习SpringMVC,所以问了这么多问题。

# re: spring mvc注解实现  回复  更多评论   

2010-11-28 19:09 by pengo
@hijackwust
你的页面不支持EL表达式,应该是有地方写错了,你自己对比下哪里写错。
“MVC注解做验证时候的国际化”,这个现在未用过,也不知。

# re: spring mvc注解例子  回复  更多评论   

2010-12-13 12:39 by pandora jewelry
spring 3,hibernate 3,没有的,自己上网下。

# re: spring mvc注解例子  回复  更多评论   

2011-03-08 16:16 by jumkey
你好,请教一下<c:out value="${student.id}"/>跟${student.id}有什么区别吗?

# re: spring mvc注解例子  回复  更多评论   

2011-03-08 22:06 by penngo
<c:out value="${student.id}"/>是jstl的标签,具体用法可以自己查下jstl。

# re: spring mvc注解例子  回复  更多评论   

2011-06-14 17:39 by willian
有个问题请教一下。Dao这个部分为什么需要单独定义,注解Dao后再自动扫描不可以么?在Dao比较多的情况下,这种定义的方式也是挺烦的。

# re: spring mvc注解例子  回复  更多评论   

2011-06-23 23:25 by penngo
@willian
因为全部只有一个通用的DAO,所以单独定义比较好,这是为了以后更换DAO的方便。

# re: spring mvc注解例子  回复  更多评论   

2011-08-25 13:59 by java zz
能不能把这个demo发我一下
894571429@qq.com
如果能万分感谢

# re: spring mvc注解例子  回复  更多评论   

2011-09-12 17:12 by 来如风
请问spring mvc 的view 路径支持 像struts2 的namespace这种么,比如说,如果是userController 就自动去/web-inf/views/user/ 路径下找对应的文件,所有jsp放在同一个目录下也挺烦人的

# re: spring mvc注解例子[未登录]  回复  更多评论   

2011-10-29 11:01 by spring
请问,controller 中的load方法是如何被调用的

# re: spring mvc注解例子[未登录]  回复  更多评论   

2011-10-29 11:04 by spring
http://localhost:8080/工程名/student.do
就能进入到controller里面的load方法吗,没明白

# re: spring mvc注解例子  回复  更多评论   

2011-11-10 16:29 by austenliao
说明一下,为什么还保留使用hibernate

# re: spring mvc注解例子  回复  更多评论   

2011-12-03 11:55 by tkreal
不好意思,我是新手,请问源码导入eclipse以后,如何运行啊?
注:tomcat等已经配置好了。

# re: spring mvc注解例子  回复  更多评论   

2011-12-18 19:06 by 上的
不错昂。

# re: spring mvc注解例子  回复  更多评论   

2012-01-10 12:29 by yong230
没有修改啊!

# 2  回复  更多评论   

2012-02-23 17:36 by 3
<script>alert('')</script>

# re: spring mvc注解例子  回复  更多评论   

2012-02-27 09:26 by 六六
整个项目报错啊,部署不了,但类和页面没有报错

# re: spring mvc注解例子  回复  更多评论   

2012-03-05 11:20 by hah
给的不全害死人啊!!!

# re: spring mvc注解例子  回复  更多评论   

2012-03-09 21:36 by Kent160
数据库没给啊?

# re: spring mvc注解例子  回复  更多评论   

2012-03-09 21:38 by Kent160
哦,看错了。不好意思!

# re: spring mvc注解例子  回复  更多评论   

2012-04-10 15:15 by testssssssssssssssssssssssssssssssssssssssssssssss
hehe . hai bu cuo ...

# re: spring mvc注解例子  回复  更多评论   

2012-04-27 13:23 by buddha
java spring jpa android技术交流QQ群122674573

# re: spring mvc注解例子  回复  更多评论   

2012-05-08 09:59 by gwb
你的项目不能正常的跑起来

# re: spring mvc注解例子[未登录]  回复  更多评论   

2012-05-18 14:05 by 石头
不错,,值得收藏

# 项目部署了,没有报错,但是运行时候就报404错  回复  更多评论   

2012-05-18 17:38 by light.young
项目部署了,没有报错,但是运行时候就报404错,不知道为啥

# re: spring mvc注解例子[未登录]  回复  更多评论   

2012-05-24 08:51 by
请教楼主,我把Service改成接口的方式,然后不用@Autowired ,我用的@Resource 注入,为什么不能用啊? 启动就报错了。求解?

# re: spring mvc注解例子  回复  更多评论   

2012-09-27 17:09 by 11
@pengo
111

# re: spring mvc注解例子[未登录]  回复  更多评论   

2012-10-16 15:16 by c
能不能把这个demo发我一下
402670211@qq.com
如果能万分感谢

# re: spring mvc注解例子[未登录]  回复  更多评论   

2012-10-17 15:39 by vincent
@penngo
不错的例子啊

# re: spring mvc注解例子[未登录]  回复  更多评论   

2012-10-17 15:39 by vincent
这里列子不错,收藏了

# re: spring mvc注解例子[未登录]  回复  更多评论   

2012-11-05 08:35 by zyy
包·········

# re: spring mvc注解例子  回复  更多评论   

2012-12-10 13:41 by 菜鸟学习
你的el表达式不能用,可能是需要在jsp页面引用jstl标签库@hijackwust

# re: spring mvc注解例子  回复  更多评论   

2012-12-12 16:46 by 小兵
<property name="mappingResources">
<list>
<value>com/szhome/*/entity/*.hbm.xml</value>
配置文件超过八十个就会报内存溢出。。什么问题

# re: spring mvc注解例子  回复  更多评论   

2013-01-24 18:36 by 你的承诺
请问有一个完整的例子吗?下载地址在哪里?

# re: spring mvc注解例子  回复  更多评论   

2013-01-24 18:37 by 你的承诺
请把下载的地址公布一下行吗?谢谢

# re: spring mvc注解例子  回复  更多评论   

2013-04-08 16:58 by suifeng
@Kent160
挺不错的

# re: spring mvc注解例子  回复  更多评论   

2013-05-13 15:42 by hasau@163.com
不能下载啊!!

有没有人贴一份啊!!

hasau@163.com

# re: spring mvc注解例子[未登录]  回复  更多评论   

2013-06-04 14:28 by ivan
我是初学者,正好找入门的资料,写的挺好,下载了!

# re: spring mvc注解例子[未登录]  回复  更多评论   

2013-09-21 10:36 by sun
收藏

# re: spring mvc注解例子  回复  更多评论   

2013-11-20 11:51 by daiweid
dsfdsfdsf

# re: spring mvc注解例子[未登录]  回复  更多评论   

2014-02-10 10:43 by jame
想法是出来了,但是dao层不全吧。公共dao层是这样的,如果要用到其他的方法你不可能都写在公共的dao层里面撒。新手求教

# re: spring mvc注解例子[未登录]  回复  更多评论   

2014-02-12 11:26 by Allen
内容挺全的

# re: spring mvc注解例子  回复  更多评论   

2014-04-11 14:45 by 余小鱼
怎么下啊

# re: spring mvc注解例子  回复  更多评论   

2014-04-27 00:17 by 最代码
请参考代码: SpringMVC入门教程及其原理讲解和实例代码下载 ,下载地址:http://www.zuidaima.com/share/1751859714182144.htm

# re: spring mvc注解例子  回复  更多评论   

2014-06-03 10:23 by azaoshu33
你用的是spring的3.几版本啊?为什么我一直报错?

# re: spring mvc注解例子  回复  更多评论   

2014-06-13 10:41 by 小星星
@pengo
sff.append("select a from ").append(Student.class.getSimpleName()).append("a");这句话的语句是这么写吗 怎么我运行的时候报错呢

# re: spring mvc注解例子  回复  更多评论   

2014-07-10 17:00 by WF
使用oracle,一直提示id不能插入null,原来@GeneratedValue忘记改了,大意了

# re: spring mvc注解例子  回复  更多评论   

2014-07-27 15:34 by 晓明
@小星星给我发一份啊,不能下载,邮箱:1635387592@qq.com

# re: spring mvc注解例子  回复  更多评论   

2014-08-04 10:29 by 上海-地瓜
@jumkey
c:out十一个鸡肋的标签,基本不用!

# re: spring mvc注解例子[未登录]  回复  更多评论   

2015-01-29 15:20 by
能不能把这个完整的例子发给我啊? 303871975@qq.com谢谢了

# re: spring mvc注解例子  回复  更多评论   

2015-05-15 14:53 by xgz
怎么访问里面的页面啊……

# re: spring mvc注解例子  回复  更多评论   

2016-06-06 11:30 by 黑科技
是分散

只有注册用户登录后才能发表评论。


网站导航: