yourenyouyu2008的博客
yourenyouyu2008 · 共 121 篇文章
tomcat7-maven-plugin插件中的deploy使用说明补充
网上有很多关于tomcat7-maven-plugin插件中的deploy使用说明,但都不是很具体,经过不断重试整理如下。 1) deploy是基于tomcat的manager功能的,首先配置manager相关的角色 在文件中配置apache-tomcat-7.0.54\conf\tomcat-users.xml <role rolename="manager-script"/><!--脚本发布 --> <role rolename="manager-gui"/><!--人工发布 --> <user username="deployer" password="s3cret" roles="m…
2015-05-16 19:44 · 项目管理-maven · 评论(0)
eclipse tomcat Server Locations选项
分别指定server path和deploy path server path中第2项会启动安装的tomcat下面webapps中的项目,第1项不会,只会启动deploy path指定的项目
2014-07-17 14:00 · 评论(0)
Map和ConcurrentMap
ConcurrentMap为map增加原子方法,用于同步操作。 V putIfAbsent(K key, V value); 如果map中还没有key就添加,有key就直接返回key对应的value * <pre> * if (!map.containsKey(key)) * return map.put(key, value); //put方法the previous value associated with key , or null if there was no mapping for key * else * return map.get(key);</pre> 使用示例:确保并…
2014-07-17 13:48 · java基础 · 评论(0)
Maven(nexus项目发布)
http://blog.sina.com.cn/s/blog_6fe280b701012trj.html 1.pom.xml配置发布的release仓库和snapshot仓库 <distributionManagement> <snapshotRepository> <id>snapshots-riil</id> <name>Snapshots</name> <url>http://172.16.13.111:8081/nexus/content/repositories/snapshots</url> </snapshotRepository> <repository> <id>relea…
2014-06-13 16:50 · 项目管理-maven · 评论(0)
Maven:CompilerException: tools.jar not found: jre7\.\lib\tools.jar
Exception: CompilerException: tools.jar not found: jre7\..\lib\tools.jar Condition:在使用Maven打包项目的时候出现这个异常,提示tools没有找到。 解决:**确定你的eclipse在 首选项--》java--》installed JREs里面的jre指向的是JDK而不是JRE,tools.jar是JDK才有的。**当然,你也可以在环境变量classpath里面将jdk的lib目录加加进去。
2014-06-13 16:49 · 项目管理-maven · 评论(0)
spring-context-support的用途
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> spring 集成freemarker一直报 Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer 但spring-webmvc.jar中确实有这个类,导入spring下的*context.support*.ja…
javabean规范,要严格遵循规范
JavaBean的命名规则 http://blog.csdn.net/antswallow/article/details/4459008 不遵循规范的后果:各种框架直接通过规范来相互使用,ide,el表达式等都使用该规范。比如jsontojava,是利用javabena规范进行转换的,下面示例导致tPLPoints属性不能被json to string private List<TPLPoint> tPLPoints; t没有大写导致的问题。 经过几天的调试才发现这个问题 。 Sun 推荐的命名规范 1 ,类名要首字母大写,后面的单词首字母大写 2 ,方法名的第一个单词小写,后面的单词首字…
单选框/复选框表示boolean 后台使用boolean接收
是否两个选项的单选框,后台使用boolean接收,value值使用 on/off或 1/0都可以转成boolean <td>是否需要用户所在地信息</td> <td><input type="radio" name="needUserLocation" value="on" <#if sysInfoCFG.needUserLocation> checked</#if> > 是 <input type="radio" name="needUserLocation" value="off" <#if !sysInfoCFG.needUserLocation> checked</#if> > 否 …
freemarker细节整理
1)function定义最好每个属性都给出默认值,如果没有默认值,调用时传入的参数是null(或空)时会找不到对应的函数。下面示例中当spaceCategory1.usedUrl时空时执行进入不到_nullTo里面 示例:如果url是空设置url为# <a href="${fn._nullTo(spaceCategory1.usedUrl,'#')}"> --> <#function _nullTo param to> <#if param!=''> <#return param> <#else> <#return to> </#if> <#return param> </#function…
2014-02-19 14:42 · mvc · 评论(0)
浏览器兼容细节整理
<a href=''>href为空时有些浏览器会将当前浏览器地址中的部分url当做点击的url,有些浏览器则不会。 所以href不能为空,空时给#,如下处理 <#if spaceCategory1.usedUrl==''> <a href="#"> <#else> <a href="${spaceCategory1.usedUrl}"> </#if>
2014-02-18 17:19 · 评论(0)
spring资料
spring组件扫描<context:component-scan/>使用详解 http://blog.sina.com.cn/s/blog_5114d71d0100rk7b.html 。。 有了<context:component-scan>,另一個<context:annotation-config/>標籤根本可以移除掉。。。 use-default-filters:默认true,会忽略下面的子元素,如<context:include-filter,这样会扫描内置的 @Component 、 @Service 和 @Controller等注解 ;false时子元素可用。 可以只使用一个c…
2014-02-12 16:41 · spring · 评论(0)
Spring代码分析一:加载与初始化
转载地址: http://www.cnblogs.com/bobzeng/articles/1877140.html 一般的Web项目都会在web.xml中加入Spring监听器,内容如下: ? 1 2 3 4 5 6 7 8 <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value…
2014-02-12 13:27 · spring · 评论(0)
spring启动流程源码分析
spring启动流程 AbstractApplicationContext 构造好beanFactory后遍历每个定义的bean,如果需要生成实例就生成实例 protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory) { // Initialize conversion service for this context. if (beanFactory.containsBean(CONVERSION_SERVICE_BEAN_NAME) && beanFactory.i…
2014-02-12 10:01 · spring · 评论(0)
关于分布式事务、两阶段提交、一阶段提交、Best Efforts 1PC模式和事务补偿机制的研究
本文原文连接: http://blog.csdn.net/bluishglc/article/details/7612811 ,转载请注明出处! 1.XA XA是由X/Open组织提出的分布式事务的规范。XA规范主要 定义了(全局)事务管理器(Transaction Manager)和(局部)资源管理器(Resource Manager)之间的接口。XA接口是双向的系统接口,在事务管理器(Transaction Manager)以及一个或多个资源管理器(Resource Manager)之间形成通信桥梁。XA之所以需要引入事务管理器是因为,在分布式系统中,从理论上讲(参考Fischer等的论…
2014-01-24 11:05 · 分布式 · 评论(0)
配置类对象统一存储
配置类对象数量不多,标识固定(通过标识可以获得唯一对象),但是种类较多,每种类都有自己独特的属性,如果每种类都使用一个表来存储,那么会产生大量的表,可以考虑将对象直接存储的方式来使用单独的表存储所有的配置类对象。 配置类对象的获取只有通过标识获取一种方式,所以对象存储表只需要两个核心字段,1)标识2)对象本身,对象可以通过序列化或者josn方式存储。对象存储作为内部机制,不对外暴露,外部使用时只需要知道对象本身即可 public class ObjectStore extends AbstractEntity{ /** * */ private static final long seria…
2014-01-22 17:09 · 方案 · 评论(0)