`
文章列表
  1 什么是并发问题。 多个进程或线程同时(或着说在同一段时间内)访问同一资源会产生并发问题。 银行两操作员同时操作同一账户就是典型的例子。比如A、B操作员同时读取一余额为1000元的账户,A操作员为该账户增加100元,B操作员同时为该账户减去 50元,A先提交,B后提交。 最后实际账户余额为1000-50=950元,但本该为 1000+100-50=1050。这就是典型的并发问题。如何解决?可以用锁。 2 java中synchronized的用法 用法1 public class Test{ public synchronized ...
测试类: public class TestLocal { private String name="wu ming shi"; public void sayHello(){ name="zhang san"; System.out.print("Hello,"+name+"\n"); } public ThreadLocal<String> message = new ThreadLocal<String>() { public Strin ...
IfStmtsMustUseBraces: Avoid using if statements without using curly braces. 翻译   if 块必须用括号:避免使用 if 块时不使用花括号 {} ·   WhileLoopsMustUseBraces: Avoid using 'while' statements without using curly braces. 翻译   while 循环必须 ...

PMD规则之Basic Rules

    博客分类:
  • java
pmd 
更多请参考:http://blog.csdn.net/jack0511/article/details/5260751   EmptyCatchBlock: Empty Catch Block finds instances where an exception is caught, but nothing is done. In most circumstances, this swallows an exception which should either be acted on or reported. 翻译   空的 catch 块:发现 ...
[8/25/09 8:45:00:515 CST] 00000042 WebApp W Error while adding servlet mapping --> /* Please set fileServingEnabled=false in the ibm-web-ext.xmi file which is under WEB-INF folder. [8/25/09 8:45:00:531 CST] 00000042 VirtualHost I SRVE0250I: Web Module has been bound to default_h ...
Class loader in WebSphere Portal WebSphere Portal Express classloading follows the WebSphere Application Server hierarchy for classpaths and search orders. A particular classloader can reference other classes as long as the other classes can be loaded by the same classloader or any of i ...

Maven pom.xml 详解

最近要把项目转换为maven的,先了解下pom.xml吧 <project xmlns="http://maven.apache.org/POM/4.0.0 " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance " xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd "> <!--父项目 ...
var htmlStr = "<div class='"+name+"' id='"+name+i+"'><p></p></div>"; $("body").append(htmlStr); $("#"+name+i+" >p").text($(this).attr('title'));  上述为项目中实现此功能的部分代码.   .text(textString)方法和.html ...
<html> <script type="text/javascript" src="jquery.js"></script> <body> <button onclick="javascript:addCurrentRow();" >添加</button> <table id="allDatas"> <tr> <th>选择图片</th&g ...
$("input[type='checkbox']:checked").each(function(){ $(this).parent().parent().find("td").each(function(){ alert($(this).text()); }); });     itarate the cell in the rows which contain the checkbox.   <table id="result" border= ...
准备做个网站练练手,希望能够通过这个网站学习到最新的技术,希望能够有创意,有人气! 经过搜集学习,初步集成如下技术: 使用spring+struts2+hibernate sping security安全框架 前端使用jquery+json jsoup过滤 Ehcache作为缓存 velocity或freemaker作为模板 openid作为登录处理 Lucene+IKAnalyzer全文搜索   慢慢来吧~~ 现在SSH已经可以跑起来,其它的还得配置使用
使用Hiberante Annotations时遇到了该问题org.hibernate .MappingException: Unknown entity在baidu和googl上搜寻了 很久也没有找到适合我的解决方法,最后发现是import Entity类造成的(使用Eclipse 自动提示导入的该包) import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; import org.hibernate.annotations.Enti ...
el表达式在jsp中不起作用 ${xxx } 现在taglib标签库不是必须定义。 web.xml中的加入这些,我就是这种方法 <web-app id=”starter” version=”2.4″ xmlns=”http://java .sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_ ...
返回INPUT是因为filedError,actionError,messageError中存在相关数据时,就会返回到INPUT,   我的错误就是设置了验证: // 会员登录验证 @Validations( requiredStrings = { @RequiredStringValidator(fieldName = "member.userName", message = "用户名不允许为空!"), @RequiredStringValidator(fieldName = "member.passwo ...
项目中出现了上述错误 mysql设置的数据类型为double的 保存时候传递给数据库的是String类型,因此报错   网上查了一下,也可能是下面原因造成的。 1.数据库中content字段的长度不够,可能太短了。 2.乱码问题造成的。  
Global site tag (gtag.js) - Google Analytics