随笔分类 - Spring
Spring相关信息
摘要:1 public class DefaultSessionListener implements HttpSessionListener { 2 3 public void sessionCreated(HttpSessionEvent arg0) { 4 5 ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(arg0.getSession().getServletContext()); 6 IMemberService memberSe...
阅读全文
摘要:到 http://www.uploadify.com/ 去下载 uploadify-v*.*.*.zip,下载后解压,只要除com文件夹外的其它文件,将这些文件放到项目WebRoot任意文件夹下!
阅读全文
摘要:package com.tg.system;import javax.servlet.http.HttpSessionEvent;import javax.servlet.http.HttpSessionListener;import org.springframework.context.ApplicationContext;import org.springframework.web.context.support.WebApplicationContextUtils;import com.tg.module.member.bean.Member;import com.tg.module.
阅读全文
摘要:beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/beans http://www.springframe
阅读全文
摘要:数据库中的创建视图就不说了!代码中,创建一个实体类,名要和数据库中的视图名一样字段也要一样,位置可以不相同@Entitypublic class MediaView { @Id private String strId; private Integer intType; private String strTitle; private Integer intState; private Long click; private Long vote; private Long comment; private String memberId; private String strNickName;
阅读全文
摘要:媒体表@Entitypublic class Media implements Serializable { ......略 @OneToMany(cascade=CascadeType.REMOVE) @JoinColumn(name = "FK_Media_id",updatable=false) private Set<MediaComment> mediaCommetnSet; // 媒体评论表}媒体评论表@Entitypublic class MediaComment implements Serializable { ......略 @ManyToO
阅读全文
摘要:父类:@Entity @Table(name="tbl_AlbumSuper") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) public class AlbumSuperClass { @Id @Column(length = 32) @GeneratedValue(generator = "system-uuid") @GenericGenerator(strategy = "uuid", name = "system-uuid") private S
阅读全文
摘要:上传文件以流方式判断类型
FILE_TYPE_MAP.put("ffd8ffe000104a464946", "jpg"); //JPEG (jpg)
FILE_TYPE_MAP.put("89504e470d0a1a0a0000", "png"); //PNG (png)
FILE_TYPE_MAP.put("47494638396126026f01", "gif"); //GIF (gif)
FILE_TYPE_MAP.put("49492a00227105008037", "tif"); //TIFF (tif)
FILE_TYPE_MAP.put("424d228c010000000000", "bmp"); //16色位图(bmp)
FILE_TYPE_MAP.put("424d8240090000000000", "bmp"); //24位位图(bmp)
阅读全文
摘要:在SpringMVC中的Controller想要重写向到某一页可以使用ModelAndViewpublicModelAndView saveAudioReplyMethod(ModelMap map,HttpServletRequest request,AudioReply reply,String audioId){User user=userService.findUserById("1");Audio audio =audioService.findAudio(audioId);replyService.saveAudioReply(reply,audio,user)
阅读全文
摘要:说起上传,相信各位都使用过,这里写的是Spring自带的上传方法,Spring CommonsMultipartResolver 上传文件
阅读全文

浙公网安备 33010602011771号