the problem of putting pc133 and pc100 together

  Recently,I changed my os from windows2000 to windows98 to test some sound card problem.After I install the windows98,the computer turned to very easy to crush,for example,open a QQ.

  At last,I entered the CMOS setup program,change the ram cycle from 2 to 3.The problem was disappear.I have two rams,one is PC133 128M,another is PC100 128M,when it works well under windows2000 OS at the cycle is 2,it can't works well under window98 os unless I change this parameter to PC100''s requirement.

  Why did this diffence between win2000 and win98 happen?I don't know.

connecting two computers

  I have a two computer,one is a very old 486DX100,another is a k6-2 475.Although several times I have connected them with print port or cable,I have spent almost half a day to connect them together recently.Why?I have forgotten some key steps.Below are some steps of connecting these two computer with cable which k6-2 has got two net card and windows2000 OS,Dx100 has got one net card and windows97 OS.

  1.install these three network card correctly;

  2.close the firewall software in k6-2 computer;(I am using rising personal firewall,this will forbid the connecting of computers if we set it in the highest security level,but I have not tested on other security level,just only close it.)

  3.k6-2 computer must open an accout for the visit of dx100(or open the Guest accout,I have not opened this accout for security reason);

  4.dx100 must login with the accout which seted in k6-2 computer;

  5.set the computer name and group for two computer,the group of these two computer are same.Set the internal network IP address for two computer,these two IP must be in the same sub network(with the same sub network forbid code子网屏蔽码);

  5.sharing internet connecting:

  I used sygate4.0 to finish this.

  1)install the sygate on k6-2 computer as a server.set the out going as "dial",and interal connect as the second network card which connecting dx100;

  2)install the sygate on dx100 as a client and set the proxy sever as k6-2;

实际项目中的StrutsPlugIn插件扩展

作者:冰莲如水

本文讲述Struts应用在实际项目中的插件类开发技术。在我们的learndiaryV1.0项目中已经有了很好的应用。通过对它的讲解,我们可以了解在应用开发中这一技术的实做经验。首先说明Struts插件扩展技术的特点:

Struts框架的一大优势在于它允许开发人员根据实际需要来扩展框架,定制客户化的功能。

Struts1.1框架提供了动态插入和加载组件的功能,这种组件被称为Struts插件。Struts插件实际上就是一个Java类,它在Struts应用启动时Struts框架调用每个插件的init()方法进行初始化,在插件的初始化阶段可以完成一些初始化的操作,如建立数据库连接,和远程系统建立连接,在当前的应用范围内加入插件类自身的实例等。在应用关闭时Struts框架会调用每个插件的 destroy()方法,destroy()方法可以用来完成释放资源的任务,如关闭数据库连接,断开与远程的连接等。任何作为插件的Java类都应该实现org.apache.struts.action.PlugIn接口。PlugIn接口包括两个方法:

       public interface PlugIn {

        /**

        *当struts应用启动时,下面的方法将被调用执行

        */

        public void init(ActionServlet servlet, ApplicationConfig config)

              throws ServletException;

       /**

       *当struts应用关闭时,将调用下面的方法,以释放资源。

       */

        public void destroy();

       }

Hibernate 存取及批量更新删除

            Hibernate 存取及批量更新删除

作者:冰莲如水

Hibernate是介于JAVA应用逻辑层与数据库层之间的一类开源的ORM中间件。ORM(即Object-Relation Mapping)从字面意义上讲就是对象-关系映射,ORM模式指的是在单个组件中负责所有实体域对象的持久化。其重点就在于把实体域对象通过一定规则上的映射机制,转化为数据库中所对应的记录,即持久化。为了更好的理解持久化,我们可以回想一下,以前所用到的通过JDBC API来对实体域对象实现的持久化。例如:

    Connetion con = null;

    PreparedStatement stmt = null;

     try{

        con = getConnection();

        con.setAutoCommit(false);

        stmt = con.prepareStatement(“insert into customers (ID, NAME, AGE) values (?,?,?)”);

        stmt.setLong(1, new Long(1));

        stmt.setString(2, new String(“ping”));

        stmt.setInt(3, new Integer(20));

        stmt.execute();

       }catch(SQLException sqlex){

           con.rollback();

         }catch(Exception e){

         …… }

        finally{

           try{

              stmt.close();

              con.close();

           }catch(Exception ex){

             …….

            }

          }

        }

thinking of a website building

  Recently,I found a website existing some secret question.I think,there are something are the commom questions.

  This website is large and I am very like him.I found his IP address and port was exposed.This is a tomcat port.When I entered the directory address,I found he didn't forbid the directories viewing!So,I could view all the contents under the directory.There were some secret information in the subdirectories.I can enter some place of website with administrator authority.

  I sent three emails to the administrator of website,but,almost 10 days past,they didn't receive these three emails.(Later,I knew this because this email address had fulled of thousands of letters,of course,I think the most of them are garbage letters.So they didn't receive that email box at all.)

  At last,I sent an email to a system user attached a picture which showing I have enter the management function of website.Then,they knew.

  From above,I think:

1.the communication between website and users must be non-blocked;

2.Can't expose the IP:PORT to the users;

3.Can't expose the location of a database file(*.mdb);

4.The user password must be MD5ed;

5.A non-hacker should not enter other's website with illegal athourity,even if you are good heart,remember,even a bird fly over the sky will leave a little.

daughter felt shame when other people blamed her

  My daughter is always free in front of us.but when she was blamed by other people,she would fell shame.

  One day,my mother took her to a neighbour home.She was playing with mistress's daughter and making great noise when the mistress was having a nap.

  The mistress was waked up by their noise.

  "You have waked up me with great noise!"she blamed at these two girls.

  Immediately,my daughter became quiet,she nestled against grandmother's leg,obviously,she felt shame.

  "Who did blame at you?" grandmother asked.

  Daughter pointed the room which mistress was in,no speaking.

(转贴)Struts的多模块设计

Struts的多模块设计

Struts在1.1以后的版本引入了模块(Module)的概念,克服了1.0的并行开发所遇到的问题。但是模板的规划往往又是比较麻烦,如果不注意,可能适得其反,影响你的开发速度。下面我们看看如何去规划一个对模块的Struts项目。

首先我们需要建立一个web的项目,接下来就要进行目录规划。如下图:

(http://www.learndiary.com/pictures/j_struts_module.gif)

 

1 首先确定项目的模块,如此项目中包含两个模块:mFirst和mSecond,当然还有缺省模板。

2 本例子中考虑到使用XDoclet自动生成Struts配置和校验文件,所以有些特殊性。在WEB-INF下建立两个目录mFirst和mSecond,用于模块配置文件的存放。同时建立merge目录,并包含相应的模块目录,主要存放XDoclet生成Struts配置文件所需要的合并文件。模板的java源码和测试代码也分别存放,这样便于管理。为了包含某些不允许从浏览器端直接访问的jsp文件,我们在WEB-INF下同时建立webpages目录,该目录下同时包含模块目录,主要存放各个模块的受限文件。

3 本例中为了集成方便,所有编译后的代码均存在同一目录下(WEB-INF\classes),编译后的测试代码同样存在同一目录下。

4 经过以上的设置,为XDoclet生成配置文件提供了方便,我们的原则是同一个模块只有一个配置文件(struts-config.xml)和校验文件(validation.xml)。

 

 

5 接下来我们只需在web.xml中进行模块声明即可,其他信息请参考struts的sample。

<init-param>

<param-name>config</param-name>

<param-value>WEB-INF/struts-config.xml</param-value>

</init-param>

<init-param>

<param-name>config/mFirst</param-name>

<param-value>WEB-INF/mFirst/struts-config.xml</param-value>

</init-param>

<init-param>

<param-name>config/mSecond</param-name>

<param-value>WEB-INF/mSecond/struts-config.xml</param-value>

</init-param>

6 完成这些信息以后,我们要注意一些事情:

struts-config.xml文件中的Controller声明,由于我们将模板的jsp文件隐藏到WEB-INF目录下,而不是在根目录下直接建立模板目录,所以必须设置forwardPattern,详细信息请参考Struts文档。请在每个模块的struts-config.xml文件中添加以下代码,在本例中为:

<controller forwardPattern="/WEB-INF/webpages/$M$P"/>

在每个模块的properties资源文件中可能都有配置Struts默认的出错信息,因为这些模块都是独立的。

7 接下来就是模块的之间的切换问题,因为在现时过程必须需要解决的问题。其实很简单,如果你想使用项目下绝对路径(包含模块目录信息),只需将forward的contextRelative属性值设置为true即可,这样模块之间切换也很容易实现。

<forward contextRelative="true" name="success"

path="/mSecond/second.do" redirect="false"/>

8 接下来就是你的代码啦,可能你要在编码中适当地考虑到项目模块之间的关系。

总结:多模块设计不太难,但是你也的考虑周全点,这样会给你的开发带来方便。在IntelliJ IDEA下,虽然在模块比较多的情况下目录很乱,通过设置excluded,让你的目录更整洁,这样就可以关注你的模块。在有些情况下,取消excluded,这样你有可以把握项目全局。

 

posted on 2005-08-17 09:03 风太少 阅读(34) 评论(0)  编辑 收藏