Java
Spring IoC Container Part 3
DefaultSingletonBeanRegistry Last time we find that in the DefaultListableBeanFactory it provides map to save bean definitions. But when getting bean instance, …
Spring IoC Container Part 2
Log4J When using Spring framework, we must use Apache Common Logging to print log in console or binary files. As we known, Spring log configuration can change …
Spring IoC Container Part 1
Let’s look a simple code within Spring below: // create and configure beans ApplicationContext context = new ClassPathXmlApplicationContext(new String[] …
3.2 Bean Scopes
Bean scopes: singleton and prototype 1. singleton Only one instance in Spring IoC container. Only return the same Bean. One instance of the bean is created for …
4.1 Resource
Resource 1. Resource API public interface InputStreamSource { InputStream getInputStream() throws IOException; } public interface Resource extends …
4.2 Using Resource
Using Resource 1. ByteArrayResource Junit test: import org.junit.Test; import org.springframework.core.io.ByteArrayResource; import …
4.3 Access Resource
Access Resource 1. ResourceLoader Spring has a DefaultResourceLoader which can return ClassPathResource, UrlResource, and ServletContextResourceLoader which …
Java Web 系统总结 (一)
一. JSP 总结 9个隐含对象及其常用方法 (虽然为 Java 代码, 但是使用 EL 表达式完全可以进行调用相关 get 方法): 1. Request (HttpServletRequest) Attribute 相关: 可以理解在 request 作用域范围内的一个存储空间, 实现方法是将键值对放入一个 …
深入理解 HTTP Session
转载于 深入理解 HTTP Session Session 在 web 开发中是一个非常重要的概念, 这个概念很抽象,很难定义,也是最让人迷惑的一个名词, 也是最多被滥用的名字之一, 在不同的场合,session一次的含义也很不相同. 这里只探讨 HTTP Session. 为了说明问题,这里基于 Java …
用 Redis 实现分布式锁 与 实现任务队列
转载于 用 Redis 实现分布式锁 与 实现任务队列 这一次总结和分享用Redis实现分布式锁 与 实现任务队列 这两大强大的功能. 先扯点个人观点, 之前我看了一篇博文说博客园的文章大部分都是分享代码, 博文里强调说分享思路比分享代码更重要 (貌似大概是这个意思, 若有误请谅解) , 但我觉得, 分享思路固然重要 …