`
42087743
  • 浏览: 237836 次
  • 性别: Icon_minigender_1
  • 来自: 合肥&上海
社区版块
存档分类
最新评论
文章列表
    hibernate配置属性中,hibernate.hbm2ddl.auto可以帮助你实现正向工程,即由java代码生成数据库脚本,进而生成具体的表结构.     在hibernate.cfg.xml中: <property name="hibernate.hbm2ddl.auto"> </property> 它包含4个属性: create : 会根据你的model类来生成表,但是每次运行都会删除上一次的表,重新生成表,哪怕2次没有任何改变 create-drop : 根据model类生成表,但是sessionFactory一关闭,表 ...
[size=small]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eclipse可以配置一些参数来优化它的运行,运行参数可以在eclipse根目录下的eclipse.ini文件中进行修改: -vmargs //关闭java字节码验证,加快类装入的速度 -Xverify:none //设置java初始 ...
&nbsp;&nbsp;&nbsp;&nbsp;It is commonly believed in the United States that school is where people go to get an education . Nevertheless , it has been said that today children interrupt their education to go to school . The distinction between schooling and education implied by this rem ...
通过JFig.jar可以实现读取配置文件,把数据保存到集合中,然后通过代理就可以实现动态加载了. Collection类 /** * @author 42087743 * 功能:读取配置文件,将数据存储到hashmap中 * 说明:为节约版面,省去了set和get方法 */ public class CollectionConfig { //设置xml文件中的name private final static String Config_Section = "collection"; //声明存储数据的hashmap private stat ...

读取资源文件

 
首先创建个类FileDirectoryConfig类,需要读取资源文件时,就可以调用这个类. public class FileDirectoryConfig { // value是资源文件中的值,key是资源文件中的键,key需要用户输入 private String value = null; // props是存储键值对的properties对象 private Properties props = new Properties(); // 通过构造方法来读取资源文件str,用户可以自定义需要读取的资源 ...
大家看看下面会打印什么: static int first = accessTooSoon(); static int second = 1; static int accessTooSoon() { return (second); } public static void main(String[] args) { System.out.println("first = " + first); } 为了让大家不看到答案 , 最后再给出答案 , 我先解释下 , static初始化块和类变量是按照其在代码中出现的顺序依 ...
javaVM虽然有自己的垃圾回收器,可以回收大部分的内存空间,但还是有部分的内存空间是回收不了的. 内存中饿对象分为3种: 1.无用的对象,但是不可达,这是C或C++中的内存泄露; 2.无用的对象,也可达,这就是java中的内存泄露; 3.有用的对象.这就不是内存泄露了. 为什么java中也会存在内存泄露呢,什么情况下会出现这种情况,下面是一个比较普遍的例子: List list = new ArrayList(); for (int i = 0; i < 1000; i++) { list.add(i); } for (int i = 0; i < 1 ...
ArrayList的特点是可以动态改变长度,但是每次改变长度的时候性能花费是很大的,所以我们可以通过它自身的ensureCapacity()事先就给它决定好长度,这里有个前提,必须大概预测它的长度是多少.但是测试出结果出乎我的意料,大家一起来看看什么原因 final int count = 100000; long startTime, stopTime, time; ArrayList<String> arrayList = new ArrayList<String>(); ArrayList<String> arrayList ...
&nbsp;&nbsp;&nbsp;&nbsp;Singers and instrumentalists have to get every note perfectly in tunes . the pianists are spared this particular anxiety , for the notes are already there , waiting for them . And it is the piano tuner's responsibily to tune the instruments for them . But they ...
项目的日志部分由我负责,哎,本来以为spring2的aop能有多难,spring1的会了,2的肯定也手到擒来,没想到,就这个整整花了我2天的时间才摆平,都崩溃了. 下面简单地写下代码和配置: @Transactional //spring事务的支持 @Aspect ...
&nbsp;&nbsp;&nbsp;&nbsp;A painter hangs his or her finished picture on a wall , and everyone can see it . A composer writes a work , but no one can hear it until it is performed . Professional singers and players have great responsibilities , for the composer is utterly dependent on t ...
&nbsp;&nbsp;&nbsp;&nbsp;British students are borrowing record amounts to pay for their studies , new goverment figures revealed last week . &nbsp;&nbsp;&nbsp;&nbsp;The total amount loaned to university students rose by 32.2 percent last year to nearly 4 billion . & ...
[size=small] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;实例方法被覆盖,静态方法被隐藏 public class testStatic { public static void main(String[] args) { Super s = new Sub(); System.out.println(s.greeting() + ", " + s.name()); } } class Super { static String greeting() { ...
struts.action.extension The URL extension to use to determine if the request is meant for a Struts action 用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的'do'字。 struts.configuration The org.apache.struts2.config.Configuration implementation class org.apache.struts2.config.Configura ...

struts2的数组显示

    博客分类:
  • SSH
<s:iterator value="list" status="stts"> <s:property value="list[#stts.index][0]"/> <s:property value="list[#stts.index][1]"/> </s:iterator>有的时候查询数据库的时候,比如"select a.id , a.name from Account a",查询结果返回的是集合,集合里封装的是数组.用了上 ...
Global site tag (gtag.js) - Google Analytics