springside quickstart代码分析01。
web端的话希望用springside里面的quickstart fork 出来作为项目的骨架。话说springside真是j2ee的范本,都是主流的开源技术,膜拜大神。
https://github.com/touchhy/springside4 简单的注释直接写在代码里了。
相关的博文: http://www.cnblogs.com/konbluesky/articles/1925295.html http://zhxing.iteye.com/blog/399668 https://github.com/springside/springside4/wiki/Reference
web.xml->contextParam->listener->filter->servlet
contextParam用来初始化servletContext,Listener分为三类ServletContextListener 监听ServletContext对象。HttpSessionListener监听Session对象
HttpRequestListener 监听Request对象。多个filter跟servlet,初始化跟运行顺序都按照声明顺序来执行。filter-name,servlet-name之后声明相应的filter-mapping,servlet-mapping。
可以自定义HttpSessionListener来记录在线人数或者是session对象的持久化跟恢复。自动压缩响应,记录用户的请求都可以通过listener filter servlet 来实现。
http://zhou5262721.iteye.com/blog/976077 http://honey-bee.iteye.com/blog/39048 http://blog.csdn.net/xtu_xiaoxin/article/details/8464808
- <web-app>
- <display-name></display-name>定义了WEB应用的名字
- <description></description> 声明WEB应用的描述信息
- <context-param></context-param> context-param元素声明应用范围内的初始化参数。
- <filter></filter> 过滤器元素将一个名字与一个实现javax.servlet.Filter接口的类相关联。
- <filter-mapping></filter-mapping> 一旦命名了一个过滤器,就要利用filter-mapping元素把它与一个或多个servlet或JSP页面相关联。
- <listener></listener>事件监听程序在建立、修改和删除会话或servlet环境时得到通知。Listener元素指出事件监听程序类。
- <servlet></servlet> 在向servlet或JSP页面制定初始化参数或定制URL时,必须首先命名servlet或JSP页面。Servlet元素就是用来完成此项任务的。
- <servlet-mapping></servlet-mapping> servlet匹配的url,使用servlet-mapping元素。
- <session-config></session-config> 如果某个会话在一定时间内未被访问,服务器可以抛弃它以节省内存。可通过使用HttpSession的setMaxInactiveInterval方法明确设置单个会话对象的超时值,或者可利用session-config元素制定缺省超时值。
- <mime-mapping></mime-mapping>如果Web应用具有想到特殊的文件,希望能保证给他们分配特定的MIME类型,则mime-mapping元素提供这种保证。http://jeenry119.iteye.com/blog/1401872
- <welcome-file-list></welcome-file-list> 指示服务器在收到引用一个目录名而不是文件名的URL时,使用哪个文件。
- <error-page></error-page> 在返回特定HTTP状态代码时,或者特定类型的异常被抛出时,能够制定将要显示的页面。
- <taglib></taglib> 对标记库描述符文件(Tag Libraryu Descriptor file)指定别名。此功能使你能够更改TLD文件的位置,而不用编辑使用这些文件的JSP页面。
- </web-app>
然后application.xml application-shiro.xml中配置的就是application级别的公用bean配置。shiro跟jpa hibernater算是大头了,之前淘宝用的是mybatis跟通用的登录页面。