君子博学而日参省乎己 则知明而行无过矣

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 107 下一页

2012年3月13日 #

摘要: i am having trouble with binding my data from a form : I have two class@Entity @Table(name = "ROLES") public class Role implements GenericDomain { private Long id; private String code; private String name; private Set<Privilege> privileges = new HashSet<Privilege>(0); public Ro 阅读全文
posted @ 2012-03-13 00:45 刺猬的温驯 阅读(422) 评论(0) 推荐(0)

摘要: In this tutorial we are going to create annotation based file upload example using Spring 3.0 MVC module.Spring 3 MVC File UploadCreating file upload example using Spring 3 MVCLearn how to create file upload application using Spring MVC module of the Spring 3 framework.In this tutorial we are going 阅读全文
posted @ 2012-03-13 00:16 刺猬的温驯 阅读(3932) 评论(0) 推荐(0)

2012年3月12日 #

摘要: @ResponseBody & @RequestBody作用?@RequestBody 将 HTTP 请求正文插入方法中,使用适合的HttpMessageConverter将请求体写入某个对象。@ResponseBody 将内容或对象作为 HTTP 响应正文返回,使用@ResponseBody将会跳过视图处理部分,而是调用适合HttpMessageConverter,将返回值写入输出流。HttpMessageConverter接口<mvc:annotation-driven />开启了之后它给AnnotationMethodHandlerAdapter初始化7个转换器,可以 阅读全文
posted @ 2012-03-12 04:07 刺猬的温驯 阅读(2501) 评论(0) 推荐(0)

摘要: 以下内容是经过自己整理资料、官方文档所得:web.xml配置:<servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <description>加载/WEB-INF/spring-mvc/目录下的所有XML作为Spring MVC的配置文件</description> & 阅读全文
posted @ 2012-03-12 01:04 刺猬的温驯 阅读(465) 评论(0) 推荐(0)

2012年3月8日 #

摘要: I have a very simple MySql table with an auto increament primary key,1CREATE TABLE sampah2(3id INT(10) NOT NULL AUTO_INCREMENT,4name VARCHAR(30),5PRIMARY KEY (id)6)my question is, how can i get my object’s generated primary key if i insert a new object to table “sampah”?The answer is actually quite 阅读全文
posted @ 2012-03-08 23:52 刺猬的温驯 阅读(332) 评论(0) 推荐(0)

摘要: One of the latest MyBatis feature is the ability to use Annotations or XML to do One-to-One or One-to-Many queries. Let’s start with an example, as usual im using PostgreSQL, Netbeans 6.9 and MyBatis 3.0.2.First is a simple database with 2 different tables,CREATE DATABASE test CREATE TABLE master .. 阅读全文
posted @ 2012-03-08 23:46 刺猬的温驯 阅读(971) 评论(0) 推荐(0)

2012年3月7日 #

摘要: In lastSpring auto-wiring in XMLexample, it will autowired the matched property of any bean in current Spring container. In most cases, you may need autowired property in a particular bean only.In Spring, you can use@Autowiredannotation to auto wire bean on the setter method, constructor or a field. 阅读全文
posted @ 2012-03-07 18:47 刺猬的温驯 阅读(479) 评论(0) 推荐(0)

摘要: packagecom.epeer.dao;publicinterfaceUserDao{publicvoidinsertUserIp(Stringstartip,Stringendip);}packagecom.epeer.dao;importjava.text.MessageFormat;importorg.springframework.jdbc.core.support.JdbcDaoSupport;publicclassUserDaoImplextendsJdbcDaoSupportimplementsUserDao{privatestaticfinalStringINSERT=&qu 阅读全文
posted @ 2012-03-07 18:11 刺猬的温驯 阅读(318) 评论(0) 推荐(0)

摘要: Spring applicationContext.xml的<context:component-scan>標籤用途比我想像的還要實用。而且後來才知道,有了<context:component-scan>,另一個<context:annotation-config/>標籤根本可以移除掉,因為被包含進去了。原本我survery Spring3通常只配置成<context:component-scan base-package="com.foo.bar"/>,意即在base-package下尋找有@Component和@Confi 阅读全文
posted @ 2012-03-07 17:18 刺猬的温驯 阅读(1689) 评论(0) 推荐(0)

摘要: 13.9.使用Spring的表单标签库 - Spring Framework reference 2.0.5 参考手册中文版13.9.使用Spring的表单标签库从2.0开始,Spring提供全面的,支持数据绑定的JSP标签来处理表单元素(如果你使用JSP和Spring的Web MVC框架的话)。 每个标签所支持的属性跟其对应的HTML标签相同,这样这些标签看起来就不陌生,而且很容易用。 由这些标签库生成的HTML页面符合HTML 4.01/XHTML 1.0标准。与其它的标签库不同,Spring的表单标签库和Spring Web MVC框架是集成在一起的,因此它们可以直接使用命令对象(com 阅读全文
posted @ 2012-03-07 17:16 刺猬的温驯 阅读(942) 评论(0) 推荐(0)

上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 107 下一页