BorderJ's Blog

          --- java FreeBsd Web3D open-sources

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            8 隨筆 :: 1 文章 :: 40 評論 :: 0 Trackbacks

          2006年7月12日 #

          Writely Blog is proud to announce that Writely access is now free for everyone. Just sign up for an account.

          Writely is a word processing tool acquired by Google this year. Since it was acquired, users were required to have an invitation to try the product. You can read my negative review, but there are many people who like Writely.
          posted @ 2006-08-18 09:53 BorderJ 閱讀(472) | 評論 (0)編輯 收藏

          HttpRequest對象有兩種形式的getSession方法調用:
          一個是getSession(),
          另一個是getSession(boolean isNew)

          這樣的,前者會檢測當前時候有session存在,如果不存在則創建一個,如果存在就返回當前的。
          getSession()相當于getSession(true),

          參數為true時,若存在會話則返回該會話,否則新建一個會話。
          參數為false時,若存在會話則返回該會話,否則應該返回一個NULL

          這是文檔:

          getSession ?
          ? public ? HttpSession ? getSession(boolean ? create)Returns ? the ? current ? HttpSession ? associated ? with ? this ? request ? or, ? if ? if ? there ? is ? no ? current ? session ? and ? create ? is ? true, ? returns ? a ? new ? session. ? ?
          ? If ? create ? is ? false ? and ? the ? request ? has ? no ? valid ? HttpSession, ? this ? method ? returns ? null. ? ?
          ? ?
          ? To ? make ? sure ? the ? session ? is ? properly ? maintained, ? you ? must ? call ? this ? method ? before ? the ? response ? is ? committed. ? If ? the ? container ? is ? using ? cookies ? to ? maintain ? session ? integrity ? and ? is ? asked ? to ? create ? a ? new ? session ? when ? the ? response ? is ? committed, ? an ? IllegalStateException ? is ? thrown. ?
          ? ?
          ? Parameters: ?
          ? true ? - ? to ? create ? a ? new ? session ? for ? this ? request ? if ? necessary; ? false ? to ? return ? null ? if ? there's ? no ? current ? session ?
          ? Returns: ?
          ? the ? HttpSession ? associated ? with ? this ? request ? or ? null ? if ? create ? is ? false ? and ? the ? request ? has ? no ? valid ? session ?


          感謝
          zhouhu的提醒,現在已經修正。
          Edit By: BorderJ??? 2006.8.18


          posted @ 2006-07-31 19:46 BorderJ 閱讀(7863) | 評論 (3)編輯 收藏

          ????????? 從各官方網站下了 php-5.1.4-Win32.zip ,apache_2.2.2-win32-x86-no_ssl.msi ,

          下載地址:
          php-5.1.4-Win32.zip :
          http://cn.php.net/distributions/php-5.1.4-Win32.zip
          apache_2.2.2-win32-x86-no_ssl.msi : http://mirror.vmmatrix.net/apache/httpd/binaries/win32/apache_2.2.2-win32-x86-no_ssl.msi

          我的安裝路徑:
          php :???????D:\border\php
          apache:????D:\border\Apache2.2

          安裝apache 并配置支持PHP:

          1.
          apache 安裝比較簡單,一路next就可以安裝完成。在你的ie中輸入 http://127.0.0.1/?,看到結果是

          ?It works!

          說明apache安裝成功!

          2.配置apache并支持php:
          ?????????把php解壓到D:\border\php,
          找到 php目錄里的 php.ini-dist重命名為 php.ini
          把php目錄加大你的path中。
          配置apache里的httpd.conf

          打開 D:\border\Apache2.2\conf\httpd.conf 這個文件

          找到 DocumentRoot "D:/php/Apache2/htdocs" 將其改為你的WEB目錄,如我的為

          DocumentRoot "D:/border/php/www"

          找到 DirectoryIndex index.html index.html.var 在后面加入 index.htm index.php (默認index.php為首頁文件)

          --------------模塊化安裝PHP----------------------------------------
          找到 #LoadModule ssl_module modules/mod_ssl.so 這行,在此行后加入一行

          LoadModule php5_module "D:/border/php5apache2.dll"

          其中D:/border/php/php5apache2.dll為你php目錄中php5apache2.dll所在的位置

          再找到 AddType application/x-gzip .gz .tgz 這行,在此行后加入一行

          AddType application/x-httpd-php .php

          在后面加上:
          ScriptAlias /php/ "D:/border/php/"
          AddType application/x-httpd-php .php


          (其實:上面兩行紅色的,你可以直接加在httpd.conf文件的最后面也可以的)
          --------------------------------------------------------------------

          此時PHP環境基本已經配置成功
          在WEB根目錄(如我的D:\border\php\www)里建一個名為test.php (提示:用記事本的朋友,請避免文件為test.php.txt) ,的文件內容如下?

          <??echo?phpinfo();??>?

          重新啟動apache服務
          用瀏覽器打開 http://localhost/test.php
          如果可以看到php配置輸出信息就OK了 .

          詳細的說明可以看說明文檔

          注:
          不過在我安裝的過程中還是遇到了些問題:

          提示:
          "Cannot load C:/border/php/php5apache2.dll into server: The specified module could not be found."

          原因:

          ?PHP壓縮包里的php5apache2.dll只適用于apache2.0.*

          解決方法:

          下載 這個文件?并解壓.共有三個文件.

          vcredist_x86.exe
          php5apache2.dll

          httpd.exe.manifest

          好,開始

          1.將 php5apache2.dll 覆蓋掉你原來PHP目錄下的 php5apache2.dll 文件.

          2.將 httpd.exe.manifest 文件復制到你的apache安裝目錄下的bin文件夾下.

          3.雙擊運行vcredist_x86.exe安裝.(如果您的系統里已安裝了 .NET framework 2.就可以省掉這一步)

          完成!去重啟你的apache2.2試試吧.

          參考:
          ?esayr??:apache 2.2.2 + PHP5.1.4 不能運行的解決辦法.??

          ????????? 從各官方網站下了 php-5.1.4-Win32.zip ,apache_2.2.2-win32-x86-no_ssl.msi ,

          下載地址:
          php-5.1.4-Win32.zip :
          http://cn.php.net/distributions/php-5.1.4-Win32.zip
          apache_2.2.2-win32-x86-no_ssl.msi : http://mirror.vmmatrix.net/apache/httpd/binaries/win32/apache_2.2.2-win32-x86-no_ssl.msi

          我的安裝路徑:
          php :???????D:\border\php
          apache:????D:\border\Apache2.2

          安裝apache 并配置支持PHP:

          1.
          apache 安裝比較簡單,一路next就可以安裝完成。在你的ie中輸入 http://127.0.0.1/?,看到結果是

          ?It works!

          說明apache安裝成功!

          2.配置apache并支持php:
          ?????????把php解壓到D:\border\php,
          找到 php目錄里的 php.ini-dist重命名為 php.ini
          把php目錄加大你的path中。
          配置apache里的httpd.conf

          打開 D:\border\Apache2.2\conf\httpd.conf 這個文件

          找到 DocumentRoot "D:/php/Apache2/htdocs" 將其改為你的WEB目錄,如我的為

          DocumentRoot "D:/border/php/www"

          找到 DirectoryIndex index.html index.html.var 在后面加入 index.htm index.php (默認index.php為首頁文件)

          --------------模塊化安裝PHP----------------------------------------
          找到 #LoadModule ssl_module modules/mod_ssl.so 這行,在此行后加入一行

          LoadModule php5_module "D:/border/php/php5apache2.dll"

          其中D:/border/php/php5apache2.dll為你php目錄中php5apache2.dll所在的位置

          再找到 AddType application/x-gzip .gz .tgz 這行,在此行后加入一行

          AddType application/x-httpd-php .php

          在后面加上:
          ScriptAlias /php/ "D:/border/php/php/"
          AddType application/x-httpd-php .php


          (其實:上面兩行紅色的,你可以直接加在httpd.conf文件的最后面也可以的)
          --------------------------------------------------------------------

          此時PHP環境基本已經配置成功
          在WEB根目錄(如我的D:\border\php\www)里建一個名為test.php (提示:用記事本的朋友,請避免文件為test.php.txt) ,的文件內容如下?

          ?

          <??echo?phpinfo();??>?

          ?

          重新啟動apache服務
          用瀏覽器打開 http://localhost/test.php
          如果可以看到php配置輸出信息就OK了 .

          詳細的說明可以看說明文檔

          注:
          不過在我安裝的過程中還是遇到了些問題:

          提示:
          "Cannot load C:/php/php5apache2.dll into server: The specified module could not be found."

          原因:

          ?PHP壓縮包里的php5apache2.dll只適用于apache2.0.*

          解決方法:

          下載 這個文件?并解壓.共有三個文件.

          ?vcredist_x86.exe
          ?php5apache2.dll

          ?httpd.exe.manifest

          好,開始

          1.將 php5apache2.dll 覆蓋掉你原來PHP目錄下的 php5apache2.dll 文件.

          2.將 httpd.exe.manifest 文件復制到你的apache安裝目錄下的bin文件夾下.

          3.雙擊運行vcredist_x86.exe安裝.(如果您的系統里已安裝了 .NET framework 2.就可以省掉這一步)

          完成!去重啟你的apache2.2試試吧.

          參考:
          ?esayr??:apache 2.2.2 + PHP5.1.4 不能運行的解決辦法.??
          ?php手冊
          ?windows 2000/XP/2003下安裝APACHE2.0.53、PHP5.0.3、MYSQL4.1.10a、PHPMYADMIN2..6.1


          ?


          ?

          posted @ 2006-07-20 18:22 BorderJ 閱讀(2641) | 評論 (6)編輯 收藏

          ?????? 在Eclipse的web開發平臺(WTP)包括了大部分web開發工具,如: source editors for HTML, Javascript, CSS, JSP, SQL, XML, DTD, XSD, and WSDL; graphical editors for XSD and WSDL; J2EE project natures, builders, and models and a J2EE navigator; a Web service wizard and explorer, and WS-I Test Tools; and database access and query tools and models.?? 也支持XDoclet, 不過自己要先下載 XDoclet . 然后在Window > Preferences > XDoclet? 進行配置.

          ???? WTP : http://www.eclipse.org/webtools/
          ???? XDoclet . http://xdoclet.sourceforge.net/xdoclet/index.html


          To use XDoclet annotation support, or to create enterprise beans, XDoclet must be installed on your system and configured to work with the workbench.

          Download and install XDoclet from http://xdoclet.sourceforge.net/xdoclet/index.html
          To configure XDoclet to work with the workbench:

          1.Click Window > Preferences > XDoclet to open the XDoclet Runtime Preferences page.
          2.Check the Enable XDoclet Builder check box to turn on annotation-based artifact creation.
          3.Use the Browse button to locate the installation directory for XDoclet (XDoclet Home).
          4.Select the Version of XDoclet that you have installed. Supported versions include 1.2.1, 1.2.2, 1.2.3.
          5.Click OK to save the preferences.

          posted @ 2006-07-18 17:52 BorderJ 閱讀(3043) | 評論 (0)編輯 收藏

          ??? 用了rome 0,8的jar包,代碼大部分來自于rome-samples-0.7 。
          對了,放個rome的鏈接Rome's Home,可以直接去下載。還有就是在用rome的時候,把信息輸出到xml文件里

          ,部分出現亂碼不知道是怎么回事,我讀的feed文件是utf-8的,我也是通過utf8讀的,但是還是有一部分亂碼。今天找了一天也沒有解決。。。

          ?1?/*
          ?2??*?Created?on?2006-7-11
          ?3??*
          ?4??*?TODO?To?change?the?template?for?this?generated?file?go?to
          ?5??*?Window?-?Preferences?-?Java?-?Code?Style?-?Code?Templates
          ?6??*/
          ?7?package?border;
          ?8?
          ?9?import?java.io.FileWriter;
          10?import?java.io.Writer;
          11?import?java.net.URL;
          12?import?java.util.List;
          13?
          14?import?com.sun.syndication.feed.synd.SyndContent;
          15?import?com.sun.syndication.feed.synd.SyndEntry;
          16?import?com.sun.syndication.feed.synd.SyndFeed;
          17?import?com.sun.syndication.fetcher.FeedFetcher;
          18?import?com.sun.syndication.fetcher.impl.FeedFetcherCache;
          19?import?com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
          20?import?com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
          21?import?com.sun.syndication.io.SyndFeedOutput;
          22?
          23?/**
          24??*?@author?Border
          25??*?
          26??*?TODO?To?change?the?template?for?this?generated?type?comment?go?to?Window?-
          27??*?Preferences?-?Java?-?Code?Style?-?Code?Templates
          28??*/
          29?public?class?RSSReader?{
          30?????private?static?final?String?feedType?=?"rss_2.0";
          31?
          32?????public?static?void?main(String[]?args)?throws?Exception?{
          33?
          34?????????String?filename?=?"E:\\ROME\\feed_fetcher2.xml";
          35?????????try?{
          36?????????????FeedFetcherCache?feedInfoCache?=?HashMapFeedInfoCache.getInstance();
          37?????????????FeedFetcher?feedFetcher?=?new?HttpURLFeedFetcher();
          38?????????????SyndFeed?feed?=?feedFetcher.retrieveFeed(new?URL(
          39?????????????????????"http://www.aygfsteel.com/border/Rss.aspx"));
          40?
          41?????????????feed.setFeedType(feedType);
          42?????????????feed.setTitle("Border's?Blog");
          43?????????????feed.setDescription("?java?Web3D?FreeBsd?");
          44?????????????feed.setAuthor("?By:border?");
          45?????????????feed.setLink("?http://www.aygfsteel.com/border?");
          46?
          47?????????????List?entryList?=?feed.getEntries();
          48?
          49?????????????for?(int?i?=?0;?i?<?entryList.size();?i++)?{
          50?????????????????SyndEntry?entry?=?(SyndEntry)?entryList.get(i);
          51?
          52?????????????????entry.setPublishedDate(entry.getPublishedDate());
          53?????????????????entry.setTitle(new?String(entry.getTitle().getBytes("utf-8")));
          54?????????????????entry.setLink(entry.getLink());
          55?
          56?????????????????SyndContent?content?=?entry.getDescription();
          57?????????????????content.setValue(new?String(content.getValue()
          58?????????????????????????.getBytes("utf-8")));
          59?????????????}
          60?????????????SyndFeedOutput?output?=?new?SyndFeedOutput();
          61?????????????Writer?writer?=?new?FileWriter(filename);
          62?????????????output.output(feed,?writer);
          63?
          64?????????????System.out.println("The?feed?has?been?written?to?the?file?["
          65?????????????????????+?filename?+?"]");
          66?????????????System.out.println("?ok?!");
          67?
          68?????????}?catch?(Exception?e)?{
          69?????????????System.out.println("ERROR:?"?+?e.getMessage());
          70?????????}
          71?????}
          72?}


          下面是生成的xml文件:

          ?1?<?xml?version="1.0"?encoding="UTF-8"?>
          ?2?<rss?xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"?xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"?xmlns:dc="http://purl.org/dc/elements/1.1/"?version="2.0">
          ?3???<channel>
          ?4?????<title>Border's?Blog</title>
          ?5?????<link>http://www.aygfsteel.com/border</link>
          ?6?????<description>java?Web3D?FreeBsd</description>
          ?7?????<language>zh-cn</language>
          ?8?????<pubDate>Thu,?06?Jul?2006?11:05:25?GMT</pubDate>
          ?9?????<dc:creator>By:border</dc:creator>
          10?????<dc:date>2006-07-06T11:05:25Z</dc:date>
          11?????<dc:language>zh-cn</dc:language>
          12?????<item>
          13???????<title>免費MySQL數據庫申譿</title>
          14???????<link>http://www.aygfsteel.com/border/archive/2006/07/06/57015.html</link>
          15???????<description>?&lt;a?&gt;&lt;img?alt=""?src="http://www.kuangfeng.cn/blog/wp-content/uploads/2006/03/db4free.jpg"?align="left"?border="0"?/&gt;&lt;/a&gt;&lt;br?/&gt;&lt;br?/&gt;&lt;br?/&gt;&lt;br?/&gt;&lt;a?&gt;Db4free&lt;/a&gt;:專業提供免費數據庫服務,支持?MySQL?5.0?5.1,支持使用Phpmyadmin進行管理,以后還將擴展支持PostgreSQL,?Firebird?等數據庫.&lt;img?src?="http://www.aygfsteel.com/border/aggbug/57015.html"?width?=?"1"?height?=?"1"?/&gt;&lt;br&gt;&lt;br&gt;&lt;div?align=right&gt;&lt;a?style="text-decoration:none;"?href="/border/"?target="_blank"&gt;Border&lt;/a&gt;?2006-07-06?19:05?&lt;a?href="/border/archive/2006/07/06/57015.html#Feedback"?target="_blank"?style="text-decoration:none;"&gt;發表評論&lt;/a&gt;&lt;/div&gt;</description>
          16???????<pubDate>Thu,?06?Jul?2006?11:05:00?GMT</pubDate>
          17???????<guid?isPermaLink="false">http://www.aygfsteel.com/border/archive/2006/07/06/57015.html</guid>
          18???????<dc:creator>Border</dc:creator>
          19???????<dc:date>2006-07-06T11:05:00Z</dc:date>
          20?????</item>
          21?????<item>
          22???????<title>剛剛大廈晃的利害,是不是有些地震叿?--??北京</title>
          23???????<link>http://www.aygfsteel.com/border/archive/2006/07/04/56502.html</link>
          24???????<description>??????剛剛大廈晃的利害,是不是有些地震叿?,在17層感覺比較厲害,不知道在北京的其他同志有沒有注意到?&lt;img?src?="http://www.aygfsteel.com/border/aggbug/56502.html"?width?=?"1"?height?=?"1"?/&gt;&lt;br&gt;&lt;br&gt;&lt;div?align=right&gt;&lt;a?style="text-decoration:none;"?href="/border/"?target="_blank"&gt;Border&lt;/a&gt;?2006-07-04?12:20?&lt;a?href="/border/archive/2006/07/04/56502.html#Feedback"?target="_blank"?style="text-decoration:none;"&gt;發表評論&lt;/a&gt;&lt;/div&gt;</description>
          25???????<pubDate>Tue,?04?Jul?2006?04:20:00?GMT</pubDate>
          26???????<guid?isPermaLink="false">http://www.aygfsteel.com/border/archive/2006/07/04/56502.html</guid>
          27???????<dc:creator>Border</dc:creator>
          28???????<dc:date>2006-07-04T04:20:00Z</dc:date>
          29?????</item>
          30?????<item>
          31???????<title>通過js等比擴大圖片的比伿</title>
          32???????<link>http://www.aygfsteel.com/border/archive/2006/07/03/56279.html</link>
          33???????<description>摘要:????在做web庿發的時?,顯示圖片是經常用到?在默認的情況下圖片是擴充,但是有的時?顯示效果會不如人意。有時容器的大小是固定的,我們要把圖片等比擴大?&lt;a?href='http://www.aygfsteel.com/border/archive/2006/07/03/56279.html'&gt;閱讀全文&lt;/a&gt;?&lt;img?src?="http://www.aygfsteel.com/border/aggbug/56279.html"?width?=?"1"?height?=?"1"?/&gt;&lt;br&gt;&lt;br&gt;&lt;div?align=right&gt;&lt;a?style="text-decoration:none;"?href="/border/"?target="_blank"&gt;Border&lt;/a&gt;?2006-07-03?12:13?&lt;a?href="/border/archive/2006/07/03/56279.html#Feedback"?target="_blank"?style="text-decoration:none;"&gt;發表評論&lt;/a&gt;&lt;/div&gt;</description>
          34???????<pubDate>Mon,?03?Jul?2006?04:13:00?GMT</pubDate>
          35???????<guid?isPermaLink="false">http://www.aygfsteel.com/border/archive/2006/07/03/56279.html</guid>
          36???????<dc:creator>Border</dc:creator>
          37???????<dc:date>2006-07-03T04:13:00Z</dc:date>
          38?????</item>
          39???</channel>
          40?</rss>
          41?
          42?


          By:border
          posted @ 2006-07-12 18:37 BorderJ 閱讀(2440) | 評論 (7)編輯 收藏

          主站蜘蛛池模板: 大埔县| 鄂尔多斯市| 堆龙德庆县| 临夏县| 黔江区| 横山县| 兴和县| 永吉县| 正镶白旗| 界首市| 和林格尔县| 来安县| 西安市| 邹城市| 五大连池市| 乐清市| 大竹县| 梨树县| 淅川县| 广河县| 阿荣旗| 梧州市| 阿瓦提县| 昆山市| 柞水县| 遵化市| 华安县| 卢氏县| 江安县| 南川市| 泸水县| 盐亭县| 布尔津县| 顺平县| 基隆市| 乌鲁木齐县| 贡觉县| 凤凰县| 沭阳县| 永清县| 昌宁县|