03 2013 档案
摘要:1 public void test() { 2 Configuration cfg = new Configuration(); 3 cfg.configure(); 4 ServiceRegistry sr = new ServiceRegistryBuilder().applySettings(cfg.getProperties()).buildServiceRegistry(); 5 SessionFactory sf = cfg.buildSessionFactory...
阅读全文
摘要:用Struts2做一个文件上传来着,本来是想写个验证方法来限制文件大小的,结果发现根本走不到我的验证方法就开始报异常了:THE REQUEST WAS REJECTED BECAUSE ITS SIZE EXCEEDS THE CONFIGURED MAXIMUM,因为拦截器先把它给截下来了,根本不给我机会啊,咋个弄呢?Google了一下发现,Struts2上床文件先要通过commons-fileupload的检查,通过了才会交给struts2的fileUpload拦截器,一开始我把fileUpload的参数设置的很大都不行,因为没覆盖文件的maxSize,不扯了,下面是解决办法:首先在配置文
阅读全文
摘要:To create a ModelDriven Action our Action class should implement theModelDriven interfaceand should include themodelDriven interceptor. The modelDriven interceptor is already included in the default stack.The next step is to implement thegetModel()method in such a way that it returns the application
阅读全文
摘要:After searching on google, I found how to solve this error.Add this to your Maven dependency(pom.xml):Do comment if you find it useful, as much as it helped me.<!-- dependency to fix JSPServletException --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>j
阅读全文
摘要:打开eclipse出现'Initializing Java Tooling' has encountered a problem. An internal error occurred during: "Initializing Java Tooling".这个问题,看到就不爽.解决办法:将如下的文件夹给删除就可以了!WORKSPACE_HOME/.metadata/.plugins/org.eclipse.core.resources/.project。但删除后可能会出现另一个问题:Could not write metadata for '/Se
阅读全文
摘要:一、Json的简单介绍从结构上看,所有的数据最终都可以分成三种类型:第一种类型是scalar(标量),也就是一个单独的string(字符串)或数字(numbers),比如“北京”这个单独的词。第二种类型是sequence(序列),也就是若干个相关的数据按照一定顺序并列在一起,又叫做array(数组)或List(列表),比如“北京,东京”。第三种类型是mapping(映射),也就是一个名/值对(Name/value),即数据有一个名称,还有一个与之相对应的值,这又称作hash(散列)或dictionary(字典),比如“首都:北京”。JSON(JavaScript Object Notation
阅读全文