??xml version="1.0" encoding="utf-8" standalone="yes"?> 在文件夹选项里改了驱动器或文件夹的图标,发现双击打开盘变成了搜?/p> 解决ҎQ?/p> q行 解决Q?/p> Google code 获取密码|不开的解军_?/p>
# Project members authenticate over HTTPS to allow committing changes. When prompted, enter your generated googlecode.com password. 在文?C:\Windows\System32\drivers\etc\hosts 中加?66.249.89.99 code.google.com
regsvr32 /i shell32.dll
转自Q?a >http://hi.baidu.com/myaspdotnet/blog/item/0b73cd3f0ab9f3c77c1e714a.html
svn checkout https://yourprj.googlecode.com/svn/trunk/ yourprj --username youraccount
2. q入>> http://code.google.com/hosting/ 然后点击>Create a new project
3. 填入信息Q?br style="line-height: normal; " />
写入目名,描述Q两个选择(不太明白啥意思)选第一个就好Q写入标{,点击定。就可以?br style="line-height: normal; " />
4. 提交成功后,选择菜单的SourceQ其中有https上传协议路径需要拷贝一份,q有一个上传密码)?br style="line-height: normal; " />
5. 打开MyEclipseQ打开需要上传的目Q点鼠标右键->team->share Project->svnQ写入https路径Q下一步,输入Google账号和上传密码,起个名,finish?br style="line-height: normal; " />
6.如果一切顺利,会自动生成一个项目目录,可以查看所有项目文件。然后进入搭建项目界面,炚w标右?>team->commit。然后开始上传项目?br style="line-height: normal; " />
7.哦了Q搭建完成?br style="line-height: normal; " />
8.如果x看自q目Q可以用览器登陆https的\径,输入Google账号和上传密码,如果成功可以看到含有项目名U的目录?/font>
PS:
需要注意的是,Google的SVN是强制开源的哦,如果不想开源又没服务器的朋友开源选择svnhost
再PS:
http地址是自L限的Q供游客下蝲代码Qhttps是我们更C码的时候用的
转自Q?/font>http://hi.baidu.com/%C0%AF%B1%CA%B9%A4%D7%F7%CA%D2/blog/item/d6f6c6d7707d81d0a044df5f.html
Hibernate Reference Documentation解释如下Q?br />
hibernate.hbm2ddl.auto Automatically validate or export schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly. eg. validate | update | create | create-drop
q个参数的作用主要用于:自动创徏|更新|验证数据库表l构?br />
如果没有此方面的需求徏议不讄此属性,默认是不Ҏ据库l构作Q何改?br />
其它几个参数的意?
validate
每次加蝲hibernateӞ验证创徏数据库表l构Q只会和数据库中的表q行比较Q不会创建新表,但是会插入新倹{?br />
create
每次加蝲hibernate旉会删除上一ơ的生成的表Q然后根据你的modelcd重新来生成新表,哪怕两ơ没有Q何改变也要这h行,q就是导致数据库表数据丢q一个重要原因?br />
create-drop
每次加蝲hibernate时根据modelcȝ成表Q但是sessionFactory一关闭,表就自动删除?br />
update
最常用的属性,W一ơ加载hibernate时根据modelcM自动建立赯的结构(前提是先建立好数据库Q,以后加蝲hibernate时根?modelc自动更新表l构Q即使表l构改变了但表中的行仍然存在不会删除以前的行。要注意的是当部|到服务器后Q表l构是不会被马上建立h的,是要{?应用W一ơ运行v来后才会?/p>
在开发Web斚w的应用时, l常需要获?服务器中当前WebRoot的物理\径?/p>
如果是Servlet , Action , Controller, 或则Filter , Listener , 拦截器等相关cLQ?我们只需要获得ServletContextQ?然后通过ServletContext.getRealPath("/")来获取当前应用在服务器上的物理地址?/p>
如果在类中取不到ServletContextӞ 有两U方式可以做刎ͼ
1. 利用Java的类加蝲机制 调用 XXX.class.getClassLoader().getResource(""); Ҏ来获取到ClassPath , 然后处理获得WebRoot目录Q这U方式只能是该class在WebRoot/WEB-INF/classes下才能生效, 如果该class被打包到一个jar文g中, 则该Ҏ失效。这时就应该用下面一U方式?/p>
2. spring框架的思\, 在WEB-INF/web.xml?Q?创徏一个webAppRootKey的param, 指定一个|默认为webapp.rootQ作为键| 然后通过Listener , 或者Filter , 或者Servlet 执行String webAppRootKey = getServletContext().getRealPath("/"); q将webAppRootKey对应的webapp.root 分别作ؓKey , Value写到System Propertiespȝ属性中。之后在E序中通过System.getProperty("webapp.root")来获得WebRoot的物理\ 径?/p>
ҎW二U的思\Q我们还可以再扩展一下。不q对于在部v在一台服务器中的应用来说Q若q不是你所需请再往下看?/p>
下面是一些得到classpath和当前类的绝对\径的一些方法。你可用其中的一些方法来得到你需要的资源的绝对\?
1. DebitNoteAction.class.getResource("")
得到的是当前cFileTest.class文g的URI目录。不包括自己Q?/p>
如:file:/D:/eclipse/springTest/WebRoot/WEB-INF/classes/
atacarnet/src/com/evi/modules/atacarnet/action/
2. DebitNoteAction.class.getResource("/")
得到的是当前的classpath的绝对URI路径?/p>
如:file:/D:/eclipse/springTest/WebRoot/WEB-INF/classes/
3. Thread.currentThread().getContextClassLoader().getResource("")
得到的也是当前ClassPath的绝对URI路径
如:file:/D:/eclipse/springTest/WebRoot/WEB-INF/classes/
4. DebitNoteAction.class.getClassLoader().getResource("") 或ClassLoader.getSystemResource("")
得到的也是当前ClassPath的绝对URI路径?/p>
如:file:/D:/eclipse/springTest/WebRoot/WEB-INF/classes/
5. 取得服务器相对\?/p>
System.getProperty("user.dir")
例如:E:\apache-tomcat-5.5.16\apache-tomcat-5.5.16\bin
我推荐用Thread.currentThread().getContextClassLoader().getResource("")来得到当前的classpath的绝对\径的URI表示?/p>
6. 取得目中的l对路径
一般用request.getRealPath("/")或request.getRealPath("/config/")
但现在不提倡用request.getRealPath("/")了,大家可试用ServletContext.getRealPath("/")Ҏ得到Web应用E序的根目录的绝对\?/p>
要取得src的文仉常容易,因ؓsrc是默认的相对目录Q比如你说要取得src下com目录的test.java文gQ你只需要这样就够了
File f = new File(com/test.java);
但如果我要取得不在src目录或者WebRoot目录下的文g呢,而是要从src或者WebRoot同的目录中取呢Q比如说doc?/p>
我的方法是q样实现的:
String path = this.getServletContext().getRealPath("/");
Properties p = new Properties();
p.load(new FileInputStream(new File(path.substring(0,(path.lastIndexOf("\\WebRoot ") + 1)) + "doc/db.properties")));
System.out.println(p.getProperty("driverName"));
转自Q?span style="font-family: Simsun; line-height: normal; font-size: medium; ">http://blog.csdn.net/c5153000/archive/2011/03/23/6272195.aspx