Byte array to hex string
|
|
Code in comments
|
|
An Example from a java.awt.Event method javadoc:
|
|
Get field descriptions (names)
|
|
知道行德
|
|
|
|
An Example from a java.awt.Event method javadoc:
|
|
|
|
Some tips for Tomcat7.
${catalina.home}/anyfish-lib
|
|
So the final packaged .war file size is reduced dramatically!
To achive Step 2 in maven, edit the pom.xml file:
|
|
Note the <packagingExcludes>%regex[WEB-INF/lib/(?!mylib-1.0.0-SNAPSHOT).*.jar]</packagingExcludes>
config above (Don’t package the common spring, logging libaries etc into .war file; keep only mylib.jar).
To deploy a new version of webapp without shutting down tomcat, use parallel deployment in tomcat7, refer to tomcat parallel deploy.
Note the <warName>${project.artifactId}##${maven.build.timestamp}</warName>
config above.
mavn 中央库默认的下载地址在国外,下载速度不稳定。开源中国做了国内镜像,参考其帮助文档配置其为中央库:
备份 Maven 的安装目录下的 conf/settings.xml 文件,再编辑它:
|
|
|
|
以上配置,
部署新版本时,一般要先停掉旧的应用,复制新应用后,再启动tomcat,这就造成中间有一段时间 tomcat 是无法对外服务的。
从Tomcat 7.0.23+开始,可以在不关闭 Tomcat 的情况下同时部署相同context path的多个不同版本的web应用。war包的命名格式形如context.war, context##2.war,context##3.war。
当用户访问 http://[url]/context 时,规则如下:
|
|
在项目根目录下执行命令
mvn package
生成 war 包,如 portal##20140922.war。
2. 部署
将 war 包上传到/anyfish_web/war/warHub 下后,执行部署脚本 parallelDeploy.sh (脚本内容见下)
并行部署脚本 parallelDeploy.sh 的功能:搜寻指定目录下最新的 war 包,然后依 Tomcat 格式,在 $TOMCAT_HOME/conf/Catalina/localhost 创建配置文件(如 portal##20140922.xml),以使 Tomcat 感知并部署此 web 工程。
|
|
Normal user: vi ~/.bashrc
|
|
Root user (set as red #):
|
|
References:
You need to implement the HttpSessionListener
interface. It receives notification events when session is created, or destroyed. In particular, its method sessionDestroyed(HttpSessionEvent se)
gets called when the session is destroyed, which happens after timeout period has finished / session was invalidated. You can get the information stored in the session via HttpSessionEvent#getSession()
call, and later do any arrangements that are necessary with the session. Also, be sure to register your session listener in web.xml
:
|
|
If you ultimately want to distinguish between invalidation and session timeout you could use the following line in your listener:
Reference:
Add dependencies in pom.xml:
Config applicationContextm.xml:
|
|
P.S. Below snippet is not working. Wonder why.
tag:
缺失模块。
1、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
2、在根目录_config.yml里添加配置:
jsonContent: meta: false pages: false posts: title: true date: true path: true text: true raw: false content: false slug: false updated: false comments: false link: false permalink: false excerpt: false categories: false tags: true