BorderJ's Blog

--- java FreeBsd Web3D open-sources

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  8 随笔 :: 1 文章 :: 40 评论 :: 0 Trackbacks

2006年8月18日 #

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 阅读(448) | 评论 (0)编辑 收藏

2006年7月31日 #

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 阅读(7782) | 评论 (3)编辑 收藏

2006年7月20日 #

          从各官方网站下了 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 阅读(2618) | 评论 (6)编辑 收藏

2006年7月18日 #

       在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 阅读(3030) | 评论 (0)编辑 收藏

自: 铁手剑谱

本系列源改编自O'Reily的Strus Cookbook,后因时间关系没再进行。如果以后有时间还需继续,可能会更简化一些 。

Struts秘籍之第1段:配置Struts应用

Struts秘籍之起式:第1.2式:部署Struts示例应用

Struts秘籍之起式:第1.3式:迁移至Struts 1.1

Struts秘籍之起式:第1.4式:升级至Struts 1.2

Struts秘籍之起式:第1.5:JSP 应用转到Struts

Struts秘籍之起式:第1.6式:管理Struts配置文件

Struts秘籍之起式:第1.7式:使用Ant进行构建和部署

Struts秘籍之起式:第1.8式:用XDoclet 产生Struts配置文件

Struts秘籍之第2段:UI

Struts秘籍之第1段:第2.1式:用插件来进行应用初始化

Struts秘籍之第1段:第2.1式:关于标签库声明

Struts秘籍之第1段:第2.3式:在JSP中使用常数

Struts秘籍之第1段:第2.4式:多配置文件

Struts秘籍之第1段:第2.5. 将应用重构为模块

Struts秘籍之第1段:第2.6. 使用多个资源束

Struts秘籍之第1段:第2.7. 访问来自于数据库中的消息资源

Struts秘籍之第1段:第2.8. 有选择地禁止Action

Struts秘籍之第2段:第3.1式:使用JSTL

Struts秘籍之第2段:第3.2式:使用Struts-EL 标签

Struts秘籍之第2段:第3.3式:显示索引属性

Struts秘籍之第2段:第3.4式:在表单中使用索引属性

Struts秘籍之第2段:第3.5式:JSTL循环中使用索引属性

Struts秘籍之第2段:第3.6式:从图像提交表单

Struts秘籍之第2段:第3.7式:动态产生JavaScript

Struts秘籍之第2段:第3.8式:使用JavaScript动态改变选择项

Struts秘籍之第2段,第 3.9式,产生动态选择列表项目

Struts秘籍之第2段:第3.10:过滤文本输入 


                                                       本系列文章来自:http://www.blogjava.net/SteelHand/category/1170.html?Show=All

posted @ 2006-07-18 12:26 BorderJ 阅读(693) | 评论 (0)编辑 收藏

2006年7月12日 #

    用了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.blogjava.net/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.blogjava.net/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.blogjava.net/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.blogjava.net/border/archive/2006/07/06/57015.html</link>
15       <description> &lt;a href="http://www.db4free.net/"&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 href="http://www.db4free.net/"&gt;Db4free&lt;/a&gt;:专业提供免费数据库服务,支持 MySQL 5.0ﺿ5.1,支持使用Phpmyadmin进行管理,以后还将扩展支持PostgreSQL, Firebird 等数据库.&lt;img src ="http://www.blogjava.net/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.blogjava.net/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.blogjava.net/border/archive/2006/07/04/56502.html</link>
24       <description>      刚刚大厦晃的利害,是不是有些地震叿 ,在17层感觉比较厉害,不知道在北京的其他同志有没有注意到὿&lt;img src ="http://www.blogjava.net/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.blogjava.net/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.blogjava.net/border/archive/2006/07/03/56279.html</link>
33       <description>摘要:    在做web庿发的时㿙,显示图片是经常用到ῂ在默认的情况下图片是扩充,但是有的时㿙显示效果会不如人意。有时容器的大小是固定的,我们要把图片等比扩大὿&lt;a href='http://www.blogjava.net/border/archive/2006/07/03/56279.html'&gt;阅读全文&lt;/a&gt;⾿&lt;img src ="http://www.blogjava.net/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.blogjava.net/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 阅读(2414) | 评论 (7)编辑 收藏

2006年7月6日 #

 



Db4free:专业提供免费数据库服务,支持 MySQL 5.0,5.1,支持使用Phpmyadmin进行管理,以后还将扩展支持PostgreSQL, Firebird 等数据库.
posted @ 2006-07-06 19:05 BorderJ 阅读(9055) | 评论 (19)编辑 收藏

2006年7月4日 #

      刚刚大厦晃的利害,是不是有些地震呀 ,在17层感觉比较厉害,不知道在北京的其他同志有没有注意到。
posted @ 2006-07-04 12:20 BorderJ 阅读(841) | 评论 (2)编辑 收藏

2006年7月3日 #

     摘要: 在做web开发的时候,显示图片是经常用到。在默认的情况下图片是扩充,但是有的时候显示效果会不如人意。有时容器的大小是固定的,我们要把图片等比扩大。  阅读全文
posted @ 2006-07-03 12:13 BorderJ 阅读(2038) | 评论 (3)编辑 收藏

仅列出标题