LittleRain

小雨不打伞 打伞雨不小

2007年2月17日

        第一步,在作为服务器的微机上安装两块网卡,联接到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,很简单吧。
posted @ 2007-09-30 21:15 小雨不打伞 阅读(328) | 评论 (0)编辑 收藏
1):http://blog.csdn.net/jrq/archive/2007/03/17/1531812.aspx
posted @ 2007-04-21 06:56 小雨不打伞 阅读(904) | 评论 (1)编辑 收藏

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

posted @ 2007-04-18 17:43 小雨不打伞 阅读(1860) | 评论 (0)编辑 收藏
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的依赖关系。
posted @ 2007-04-02 13:16 小雨不打伞 阅读(348) | 评论 (0)编辑 收藏
1:http://tiwen.javaeye.com/blog/66624
2:http://www.blogjava.net/czcode/archive/2006/12/18/88448.html
3:http://hbcui1984.javaeye.com/blog/post/230199
posted @ 2007-04-02 10:05 小雨不打伞 阅读(445) | 评论 (0)编辑 收藏
http://cs.cuc.edu.cn/linweiguo/archives/000023.html#2
这里是原文地址
posted @ 2007-03-20 18:27 小雨不打伞 阅读(416) | 评论 (0)编辑 收藏
(一)关联(Association)
一对一、一对多、多对多
class A
{
   private B b;
}

class B
{
   private A a;
}

(二)依赖(Dependency)
A以来B:类A访问B的属性或方法,或者类A负责实例化类B,但是类B不是类A的属性。

(三)聚集(Aggregation)
指的是整体与部分的关系:如人和手的关系,部分类不能脱离整体类单独存在。
posted @ 2007-03-17 11:55 小雨不打伞 阅读(557) | 评论 (0)编辑 收藏

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中的。

posted @ 2007-03-14 09:10 小雨不打伞 阅读(508) | 评论 (0)编辑 收藏
   凸-_-'',前面马上就快写完了,机器居然突然重启,我。。。
   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-1testUrl-2testUrl-3
   
posted @ 2007-03-12 11:53 小雨不打伞 阅读(2052) | 评论 (0)编辑 收藏

2.1. Eclipse 3.1.x

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.

Features in JBoss Eclipse IDE 1.5.

Figure 2.1. Features in JBoss Eclipse IDE 1.5.

posted @ 2007-02-17 00:40 小雨不打伞 阅读(11315) | 评论 (0)编辑 收藏

公告

点击这里给我发消息 QQ:232720563


  MSN:new_haihua@hotmail.com

导航

统计

常用链接

留言簿(2)

随笔分类(51)

最新随笔

积分与排名

最新评论

阅读排行榜