博客统计信息

用户名:tewuxiaoqiang
文章数:46
评论数:9
访问量:28082
无忧币:20
博客积分:690
博客等级:2
注册日期:2007-11-26

我最近发表的评论

背景音乐

我的音乐

00:00 | 00:00

2009-08-01 12:27:59
Spring 以bean 管理所有的组件。
Spring上下文是产生bean 的工厂,用工厂来创建bean 的实例。。(即内部使用了工厂模式) 你无须自己写工厂类,spring帮你完成。Spring用BeanFactory接口。
org.springframework.context.ApplicationContext是其子接口,该接口更强的功能,也称为spring上下文。
其常用实现类org.springframework.context.support.FileSystemXmlApplicationContext。
//如下是产生的一个实例化的spring容器,即一个工厂实例对象ctx。
ApplicationContext ctx = new FileSystemXmlApplicationContext("src/applicationContext.xml");
//如下用ctx根据bean的id属性来获得bean实例。
ctx.getBean(String id);
 
spring产生bean 实例时,需要知道每个bean 的实现类在哪,和其各bean 类间的关系。这全部在applicationContext.xml配置文件下就行配置。。
 
这个配置文件有其固定格式。根元素是<beans></beans>
其下每个<bean>子元素中定义一个bean.定义bean 时有两个属性,id 和 class
 
有三种实例化bean 的方式
(1)调用构造器“new”一个bean实例
(2)BeanFactory调用某个类的静态工厂方法创建bean.
(3)..
类别:SSH|阅读(79)|回复(0)|(0)阅读全文>>
2009-07-27 22:41:38
struts官网:http://struts.apache.org/downloads.html
 
When you submit a HTML form to the framework, the input is not sent to another server page, but to a Java class that you provide. These classes are called Actions. After the Action fires, a Result selects a resource to render the response. The resource is generally a server page, but it can also be a PDF file, an Excel spreadsheet, or a Java applet window.
Suppose you want to create a simple "Hello World" example that displays a welcome message. to create a "Hello World" example, you need to do three things:

Create a server page to present the messages
Create an Action class to create the message
Create a mapping to couple the action and page







By creating these components, we are separating the workflow into three well-known concerns: the View, the Model, and the Controller. Separating concerns makes it easier to manage applications as they become more complex.
How the Code Works
Your browser sends to the web server a request for the URL http://localhost:8080/tutorial/HelloWorld.action.

The container receives from the web server a request for the resource HelloWorld.action. According to the settings loaded from the web.xml, the container finds that all requests are being routed to org.apache.struts2.dispatcher.FilterDispatcher, including the *.action requests. The FilterDispatcher is the entry point into the framework.
The framework looks for an action mapping named "HelloWorld", and it finds that this mapping corresponds to the class "HelloWorld". The framework instantiates the Action and calls the Action's execute method.
The execute method sets the message and returns SUCCESS. The framework checks the action mapping to see what page to load if SUCCESS is returned. The framework tells the container to render as the response to the request, the resource HelloWorld.jsp.
As the page HelloWorld.jsp is being processed, the <s:property value="message" /> tag calls the getter getMessage of the HelloWorld Action, and the tag merges into the response the value of the message.
A pure HMTL response is sent back to the browser.
For detailed information on Struts 2 architecture see Big Picture.
类别:SSH|阅读(18)|回复(0)|(0)阅读全文>>
2009-05-27 15:17:42
首先简单介绍一下:
cacti 是一个用 rrdtool 来画图的网络监控系统,  通常一说到网络管理, 大家首先想到的经常是 mrtg, 但是 mrtg 画的图简单且难看, rrdtool 虽然画图本领一流, 画出来的图也漂亮, 但是他也就是一个画图工具, 不像 mrtg 那样本身还集成了数据收集功能. cacti 则是集成了各种数据收集功能,然后用 rrdtool 画出监控图形. 其本身界面比起同类系统要漂亮不少. 推荐所有有监控需求的人都去研究一下.
cacti 和 nagios 是不同功用的系统, nagios 适合监视大量服务器上面的大批服务是否正常, 重点并不在图形化的监控, 其集成的很多功能例如报警,都是 cacti 没有或者很弱的. cacti 主要用途还是用来收集历史数据和画图, 所以界面比 nagios 漂亮很多
 
1. 主要对流量及主机在线状态监控软件,如最初的MRTG,PRGT,CACTI,Hobbit,
2. 能对服务器的关键服务及进程进行监控的软件,如Big Brother,Nagios,
2009-02-20 16:28:35
bashrc与profile的区别
要搞清bashrc与profile的区别,首先要弄明白什么是交互式shell和非交互式shell,什么是login shell 和non-login shell。
交互式模式就是shell等待你的输入,并且执行你提交的命令。这种模式被称作交互式是因为shell与用户进行交互。这种模式也是大多数用户非常熟悉的:登录、执行一些命令、签退。当你签退后,shell也终止了。 shell也可以运行在另外一种模式:非交互式模式。在这种模式下,shell不与你进行交互,而是读取存放在文件中的命令,并且执行它们。当它读到文件的结尾,shell也就终止了。
bashrc与profile都用于保存用户的环境信息,bashrc用于交互式non-loginshell,而profile用于交互式login shell。系统中存在许多bashrc和profile文件,下面逐一介绍:
/etc/pro此文件为系统的每个用户设置环境信息,当第一个用户登录时,该文件被执行.
并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取。有些linux版本中的/etc目录下已经没有了bashrc文件。
~/. pro每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该
文件仅仅执行一次..
2009-02-20 11:42:08
搭建环境
三台电脑:一台装apache,做为loadbalancer,另二台装jboss,分别做为node1,node2
 
配置负载均衡节点:
操作系统centos5.0用yum自带安装httpd,查看版本号用httpd -version命令,版本为Apache/2.2.3,配置文件在/etc/httpd/conf/httpd.conf
下载mod_jk.so,拷贝到,/etc/httpd/modules
添加可执行权限:#chmod +x /etc/httpd/modules/mod_jk.so
添加配置文件mod_jk.conf,同时将路径加到httpd.conf中,用Include conf/mod_jk.conf
内容如下:
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
# Mount your applications
#jkMount /application/* loadbalancer
jk..
 <<   1   2   3   4   5   >>   页数 ( 1/10 )

公告