置頂隨筆
windows安裝基于Apache的Subversion服務器
1.先下載并安裝Apche/Subversion/TortoiseSVN
apache:http://httpd.apache.org/download.cgi
Subversion:http://subversion.tigris.org/
TortoiseSVN:http://tortoisesvn.tigris.org/
我用的是apche2.0.55/svn-1.3.2/TortoiseSVN-1.3.5.6804
注意:目前的subversion1.3.2只能跟Apache2.0.x配合,不能用于Apache2.2.x
建議:先裝apache再安裝svn,這樣可以讓svn自動搜索到以安裝的apache,省去一些設置。否則自己參考網上不是這種安裝順序的解決辦法。
2.path中添加svn的bin目錄,測試apache和svn是否安裝成功。
3.(下面均以我自己的目錄為例)
建立目錄:G:\svnhome\svn1(svnhome用來保存每個工程的版本庫,svn1為其中一個project)
并建立初始化配置:G:\svnhome\svn1文件夾右鍵-->TortiseSVN-->Create Repository here
創建客戶端工作目錄G:\svnuser??????????????????????????????????????????
????????????????????????????????????????????????|
????????????????????????????????????????????? svn1???????????????????????????????????????????????
??????????????????????????????????????????????? |----user1
??????????????????????????????????????????????? |----user2
??????????????????????????????????????????????? |----user3
??????????????????????????????????????????????svn1_work
用來初始化訪問初始結構的。
4.開啟svn服務(對G:\svnhome目錄下的所有project開啟服務)
命令行下:svnserve -d -r g:\svnhome
5.導入初始化版本庫配置(即G:\svnhome\svn1目錄)配置,
??G:\svnuser\svn1右鍵->tortoise->import
? url of repository:svn://localhost/svn1(svn://localhost表示本地對應G:\svnhome目錄,svn1表示項目名,)
? import message:隨便寫
這時會出現錯誤提示(見下圖):

錯誤原因:是因為沒有對svnhome\svn1目錄下的配置文件進行過設置
具體設置:a)g:\svnhome\svn1\conf下的svnserve.conf文件中:[general]、anon-access = read、auth-access = write
????????????????????????? password-db = passwd前面的#去掉,其他不變。
?????????????????????b)a)中相同目錄下的passwd文件中:harry = harryssecret和 sally = sallyssecret前面的#去掉
???????????????????????? 并且可以執行添加自己需要的用戶名和密碼。
接下來就可以再次進行步驟5了,正確提示:Compelet at version1
6. 檢出原始文件信息:G:\svnuser\svn1_work目錄右鍵->SVN Checkout
?????????????URL of repository:svn://localhost/SVN1
?????????????Checkout directory:G:\svnuser\svn1_work
??????ok確定,正確提示:Complete at version1
??????這個時候去G:\svnuser\svn1_work目錄下觀察,發現已經將G:\svnuser\svn1下的文件結構全部導入。
??
7 .打開%APACHE_HOME%\conf\httpd.conf文件,在末尾添加如下語句:(關于其中)
??? <Location /svn>
??????DAV svn
??????SVNParentPath G:\svnhome
??? </Location>
<Location /svn>:意味著可以通過像這樣的URL(http://MyServer/svn)來訪問Subversion版本庫
DAV svn:告訴Apache哪個模塊負責服務像那樣的URL--在這里就是Subversion模塊SVNParentPath G:\svnhome:告訴Subversion在目錄G:\SVN下尋找版本庫
8 .重啟apache,輸入url:http://localhost/svn/svn1/,正確顯示:

9,支持svn的基本功能搭建完畢。再配合花生殼,就可以搭建遠程的svn系統了。
Eclipse中安裝subclipse插件使用subvsersion
1.到http://subclipse.tigris.org/站點找Installation教程,一般是為了找新的用來在eclipse中更新的url(有時候會變化的)
2.用eclipse自帶的plugin的update功能安裝即可,注意版本問題,好像目前為止只支持到3.x的
2007年9月30日
第一步,在作為服務器的微機上安裝兩塊網卡,聯接到ISP的網卡取名"外網卡",聯接到局域網的網卡取名"內網卡";
第二步,在"外網卡"上配置IP地址和子網掩碼(由ISP提供),如IP是10.32.101.11,子網掩碼是255.255.255.0(表示局域網規模小于256臺);其它都按ISP的要求設置。注意:下面的操作是關鍵:
1、在Windows 2000操作系統中,雙擊"外網卡"連接屬性,選"共享"標簽,選中"啟用此連接的Internet連接共享"項。
2、在Windows 98操作系統中,點設置,控制面板,雙擊Internet選項,點"連接"標簽,單擊"局域網設置"下的"共享"選項,選中"啟用此連接的Internet連接共享"項。
第三步,"內網卡"IP地址設為:192.168.0.1。
第四步,局域網中其它客戶機網卡靜態設置為192.168.0.2到192.168.0.253之間的任何IP地址,網關、DNS均設為192.168.0.1(即服務器"內網卡"的IP地址),照此設置,即可共享一條線路連上Internet,很簡單吧。
2007年4月21日
1):http://blog.csdn.net/jrq/archive/2007/03/17/1531812.aspx
2007年4月18日
1.使用Servlet2.4/jsp2.0
1. 確定Web Container支持Serverlet2.4, 復制支持jstl 1.1版本的jstl.jar,standard.jar(可查閱meta-inf)到web-inf/lib。
2. 在Web.xml,Root節點改為
<web-app 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_4.xsd ">
3.在jsp中,對core,ftm taglib的引入改為
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"% >
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"% >
2.直接在html里面使用EL,而不是<c:out value="">
充分使用JSP2.0的EL,直接在html中寫${book} 而不是<c:out value="${book}">將獲得簡潔無比,可比美velocity,freemarker的界面。
3.新增的Function標簽
Function標簽里最有用的一項是取得List,Map的size了。另外有一些StringUtils和Collection的函數。
JSTL里面不給調用對象除getXXX()外的任何方法真是件很讓讓人郁悶的事情??!
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
${fn:length(myList)}
4.其他的EL知識點
4.1 EL的運算符
除了最基本的算術運算符,邏輯運算符,比較運算符外,還有一個empty運算符,用來判斷變量是否為null 或list, map的size 是否為零。
<c:if test="${not empty myList}">
EL的運算符都有文字和符號兩種版本,如|| 和 or, >= 和 ge,適用于不能使用文字或符號的時候。
4.2 []與. 兩種訪問屬性或元素的方式
${book.name}與${book["name"]}等價。
${book["name"]}主要用于"name"串為變量,或者字符串中含有"."字符的情況
如 ${myMap[order.status]} 是訪問Map元素的一種很重要的方式。
4.3 list與map
orderList[0] 返回第一個元素
用key和value遍歷map
<c:forEach var="entry" items="${myMap}">
<option value="${entry.key}">${entry.value}</option>
</c:forEach>
4.4.訪問靜態變量
EL本身不支持靜態變量訪問,變通的方法是寫一個tag,將某個類的靜態變量反射到一個map中, 如http://www.javaranch.com/journal/200601/Journal200601.jsp#a3
不過使用Map將失去靜態變量編譯期安全的意義,因此還是建議在這種情況下,使用普通JSP,見showOrder.jsp
2007年4月2日
chapter2:
package com.apress.prospring.ch2;
import java.io.FileInputStream;
import java.util.Properties;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;
public class HelloWorldWithDI {
public static void main(String[] args) throws Exception {
//get BeanFactory
BeanFactory factory=getBeanFactory();
MessageRenderer mr=(MessageRenderer)factory.getBean("renderer");
mr.render();
}
private static BeanFactory getBeanFactory() throws Exception {
// get the bean factory
DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
// create a definition reader
PropertiesBeanDefinitionReader rdr = new PropertiesBeanDefinitionReader(
factory);
// load the configuration options
Properties props = new Properties();
props.load(new FileInputStream("./ch2/src/conf/beans.properties"));
rdr.registerBeanDefinitions(props);
return factory;
}
}
beans.properties:
renderer.class=com.apress.prospring.ch2.StandardOutMessageRenderer
renderer.messageProvider(ref)=provider
provider.class=com.apress.prospring.ch2.HelloWorldMessageProvider
DefaultListableBeanFactory負責從properties文件讀取BeanFactory的配置信息,然后返回已配置的實例。
這個配置文件已經定義了DI關系,所以在main方法中無需設置MessageRenderer 和MessageProvider的依賴關系。
1:http://tiwen.javaeye.com/blog/66624
2:http://www.aygfsteel.com/czcode/archive/2006/12/18/88448.html
3:http://hbcui1984.javaeye.com/blog/post/230199
2007年3月20日
2007年3月17日
(一)關聯(Association)
一對一、一對多、多對多
class A
{
???private B b;
}
class B
{
???private A a;
}
(二)依賴(Dependency)
A以來B:類A訪問B的屬性或方法,或者類A負責實例化類B,但是類B不是類A的屬性。
(三)聚集(Aggregation)
指的是整體與部分的關系:如人和手的關系,部分類不能脫離整體類單獨存在。
2007年3月14日
1)"Caused by: java.sql.SQLException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, testoption.content as content, testoption.score as score, testoption.Ques' at line 1"
----:在你的pojo中定義了數據庫的key word,例如:group等等.
2)net.sf.hibernate.QueryException: could not resolve property type: username [select user.password from cn.org.sppc.ipmanager.User user where user.username=?]
----:username在Form類中、在Hibernate的xml文件中和相對應的PO對象中名稱都要保持一致(包括大小寫)。包括struts-config.xml中的。
2007年3月12日
???凸-_-'',前面馬上就快寫完了,機器居然突然重啟,我。。。
???ofbiz的homepage:
http://ofbiz.apache.org?,那里沒有找到下載的鏈接,在
https://ofbiz.dev.java.net找到了。具體
下載地址。
???(1)我這里下的是:
OFBiz-2.1.1-Apps,下載完畢后解壓,得到一個ofbiz的目錄。
???(2)安裝jdk1.3+(不是jre)版本,配置好JAVA_HOME并將其添加到PATH下,cmd下java -version看到版本信息就ok了。進入下一步。
???(3)cmd下進入(1)中解壓得到的ofbiz目錄,通過命令“
java -jar ofbiz.jar”進行ofbiz的初始化,初始化完畢后大家可以通過幾個url來驗證安裝的情況。
testUrl-1、
testUrl-2、
testUrl-3。
???
2007年2月17日
Follow these steps :
- Start Eclipse.
- Select Help > Software Updates > Find and Install...
- Select Search for new features to install, and press Next >
- Select New Remote Site... from the right menu. In the dialog fill the name with JBoss Eclipse IDE and the URL with http://download.jboss.org/jbosside/updates/stable
- Make sure JBoss Eclipse IDE has a check next to it, and press Finish.
- Expand the JBoss Eclipse IDE tree, and check the release named JBossIDE 1.5. Click Next >, and Eclipse will ask you if you agree to the licensing terms of JBoss Eclipse IDE. If you agree, select I accept the terms in the license agreement, and press Next >
- Eclipse will show you a list of features it is going to install. See Figure 1. Press Finish to start installation.
- After all the features have been downloaded, Eclipse will prompt if you want to install each feature. The quickest way to install everything is to press the Install All button.
- At the end of the installation, you will be prompted to restart Eclipse. Click Yes.
Tip
If you are behind a proxy you have to go to Window > Preferences > Install/Update, select Enable HTTP Proxy Connection and insert values for Host Address and Port.
Tip
You can be notified when new updates are available. You can also configure Eclipse to fetch new updates and make them ready to install. All this configuration can be done through the Help > Software Updates > Configuration Manager menu.
Have a look at the Eclipse documentation to get more information about the Configuration Manager.