
2006年8月22日
http://210.82.53.59/down/music/proudofyou.mp3
Proud Of You
Fiona Fung
Love in your eyes, sitting silent by my side
Going on, holding hand, walking through the nights
Hold me up, hold me tight, lift me up to touch the sky
Teaching me to love with heart, helping me open my mind
I can fly. I'm proud that I can fly
To give the best of mine till the end of the time
Believe me I can fly. I'm proud that I can fly
To give the best of mine. The heaven in the sky
Stars in the sky wishing once upon a time
Give me love, make me smile till the end of life
Hold me up. Hold me tight. Lift me up to touch the sky
Teaching me to love with heart, helping me open my mind
I can fly. I'm proud that I can fly
To give the best of mine till the end of the time
Believe me I can fly. I'm proud that I can fly
To give the best of mine. The heaven in the sky
Can't you believe that you light up my way?
No matter how that ease my path I'll never lose my faith
See me fly I'm proud to fly up high
Show you the best of mine till the end of the time
Believe me I can fly I'm singing in the sky
Show you the best of mine The heaven in the sky
Nothing can stop me spread my wings so wide
参考译文(来自互联网)
你眼中充满爱意,静静的坐在我身旁。沿途挽着你的手,慢步整个晚上
抱起我,抱紧我,让我能触摸到天空。懂得了用心去爱,助我把心窗打开
我会飞了,飞让我骄傲。给你我的全部,直至时光停顿
我真的会飞,飞令我骄傲。给你我的全部,天上的天国
天上繁星,希望有一天。爱的降临让我欢笑,直至我的一生
我会飞了,飞让我骄傲。给你我的全部,直至时光停顿
我真的会飞,飞令我骄傲。给你我的全部,天上的天国
你可相信、你已照亮了我的前路。我的路途如何已不重要,我决不失去信心
看我飞,高飞让我骄傲。给你展现最佳的我,直至时光停顿
我真的会飞,在天上高歌。给你展现最佳的我,天上的天国
没什么能停止我展翅高飞。
posted @
2006-08-22 21:16 阿成 阅读(77) |
评论 (0) |
编辑 收藏
前几天不是一个同事使用OpenSessionInView pattern时,遇到Hibernate 3的mappinglazy="true"的问题,也不会想到它
struts启动spring的WebApplicationContext
spring有三种启动方式,使用ContextLoaderServlet,ContextLoaderListener和ContextLoaderPlugIn.
看一下ContextLoaderListener的源码,这是一个ServletContextListener
/**
* Initialize the root web application context.
*/
public void contextInitialized(ServletContextEvent event) {
this.contextLoader = createContextLoader();
this.contextLoader.initWebApplicationContext(event.getServletContext());
}
/**
* Create the ContextLoader to use. Can be overridden in subclasses.
* @return the new ContextLoader
*/
protected ContextLoader createContextLoader() {
return new ContextLoader();
}
contextLoader的源码
public WebApplicationContext initWebApplicationContext(ServletContext servletContext)
throws BeansException {
long startTime = System.currentTimeMillis();
if (logger.isInfoEnabled()) {
logger.info("Root WebApplicationContext: initialization started");
}
servletContext.log("Loading Spring root WebApplicationContext");
try {
// Determine parent for root web application context, if any.
ApplicationContext parent = loadParentContext(servletContext);
WebApplicationContext wac = createWebApplicationContext(servletContext, parent);
servletContext.setAttribute(
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
if (logger.isInfoEnabled()) {
logger.info("Using context class [" + wac.getClass().getName() +
"] for root WebApplicationContext");
}
if (logger.isDebugEnabled()) {
logger.debug("Published root WebApplicationContext [" + wac +
"] as ServletContext attribute with name [" +
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE + "]");
}
if (logger.isInfoEnabled()) {
long elapsedTime = System.currentTimeMillis() - startTime;
logger.info("Root WebApplicationContext: initialization completed in " + elapsedTime + " ms");
}
return wac;
}
catch (RuntimeException ex) {
logger.error("Context initialization failed", ex);
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex);
throw ex;
}
catch (Error err) {
logger.error("Context initialization failed", err);
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, err);
throw err;
}
}
注意WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,这里面放了WebApplicationContext,需要使用时从ServletContext取出
可以使用WebApplicationContextUtils得到WebApplicationContext
public static WebApplicationContext getWebApplicationContext(ServletContext sc) {
Object attr = sc.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
if (attr == null) {
return null;
}
if (attr instanceof RuntimeException) {
throw (RuntimeException) attr;
}
if (attr instanceof Error) {
throw (Error) attr;
}
if (!(attr instanceof WebApplicationContext)) {
throw new IllegalStateException("Root context attribute is not of type WebApplicationContext: " + attr);
}
return (WebApplicationContext) attr;
}
关键的问题在于struts如何启动的spring的,ContextLoaderPlugIn的源码
// Publish the context as a servlet context attribute.
String attrName = getServletContextAttributeName();
getServletContext().setAttribute(attrName, wac);
public String getServletContextAttributeName() {
return SERVLET_CONTEXT_PREFIX + getModulePrefix();
}
不同加载的Key竟然不同,原因就是WebApplicationContext放在那里的问题,可spring调用的时候会根据WebApplicationContext里面定义的那个名字去找的,问题出在这里
在struts-config.xml中配置
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
</plug-in>
<controller>
<set-property property="processorClass" value="org.springframework.web.struts.DelegatingRequestProcessor" />
</controller>
原理是这样的,Struts虽然只能有一个ActionServlet实例,但是对于不同的子应用分别能有自己的RequestProcessor实例每个RequestProcessor实例分别对应不同的struts配置文件。
子应用的ProcessorClass类必须重写一般就是继承RequestProcessor类,然后再其配置文件的controller元素中的<processorClass>属性中作出修改。那么当
getRequestProcessor(getModuleConfig(request)).process(request,response);就能根据request选择相应的moduleconfig,再根据其<processorClass>属性选择相应的RequestProcessor子类来处理相应的请求了。
posted @
2006-08-22 16:14 阿成 阅读(114) |
评论 (0) |
编辑 收藏
Tomcat的class加载的优先顺序一览
1.最先是$JAVA_HOME/jre/lib/ext/下的jar文件。
2.环境变量CLASSPATH中的jar和class文件。
3.$CATALINA_HOME/common/classes下的class文件。
4.$CATALINA_HOME/commons/endorsed下的jar文件。
5.$CATALINA_HOME/commons/i18n下的jar文件。
6.$CATALINA_HOME/common/lib 下的jar文件。
(JDBC驱动之类的jar文件可以放在这里,这样就可以避免在server.xml配置好数据源却出现找不到JDBC D
posted @
2006-08-22 16:11 阿成 阅读(77) |
评论 (0) |
编辑 收藏
http://www.databaseanswers.org/data_models/index.htm
posted @
2006-08-22 09:30 阿成 阅读(96) |
评论 (0) |
编辑 收藏
摘要: 1.
关于
hibernate
缓存的问题:...
阅读全文
posted @
2006-08-22 09:23 阿成 阅读(178) |
评论 (0) |
编辑 收藏