您的位置:首页 > 其它

关于Laszlo(2.x 3.0)无法动态加载资源的问题

2005-01-04 16:53 537 查看
问题:

Laszlo服务器不论是2.x还是3.0beta都无法动态加载资源,而LPS服务器本身是支持动态加载的,否则也不叫服务器了!

测试:

下面是个简单的动态加载图像的demo

<?xml version="1.0" encoding="utf-8"?>

<canvas debug="true">

    <debug x="150" />

    <simplelayout axis="y" spacing="10" />

        <button>Call setSource

            <method event="onclick">

            foo.setSource( 'http://localhost:8080/lps-3.0b1/test/test.jpg' );

            </method>

        </button>

    <view id="foo" />

</canvas>

测试结果:

运行点击按钮后,可以触发button的onclick事件,设置view的资源为uri上的一个图片。结果却是无法正确显示图片,打开debug窗口显示错误为:

string(4444)#0| java.text.ParseException:

    Unparseable date: "Tue, 21 Dec 2004 06:42:22 GMT" :

    Exception stack: org.openlaszlo.utils.ChainedException: 

    java.text.ParseException: 

    Unparseable date: "Tue, 21 Dec 2004 06:42:22 GMT"  

    at org.openlaszlo.utils.LZHttpUtils.getDate(LZHttpUtils.java:128)

    at org.openlaszlo.data.HTTPDataSource$HttpData.lastModified(HTTPDataSource.java:497)

    at org.openlaszlo.cache.RequestCache.getItemStreamAsSWF(RequestCache.java:320)

    at org.openlaszlo.cache.RequestCache.getAsSWF(RequestCache.java:128)

    at org.openlaszlo.servlets.responders.ResponderCache.respondImpl(ResponderCache.java:358)

    at org.openlaszlo.servlets.responders.Responder.respond(Responder.java:220)

    at org.openlaszlo.servlets.LZServlet._doGet(LZServlet.java:308)

    at org.openlaszlo.servlets.LZServlet.doGet(LZServlet.java:244)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFi

/**//**

private static SimpleDateFormat getGMTFormatter() SimpleDateFormat dateFormatter =

new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");

TimeZone tz = TimeZone.getTimeZone("GMT");

dateFormatter.setTimeZone(tz);

return dateFormatter;

}

结论:

也就是说应该是服务器区域设置不兼容了。我运行Tomcat的服务器是Windows2000区域设置当然是中文了,现在改成en-us,并重新启动Tomcat服务器后,上面的demo测试代码就能正常工作了。

看来Laszlo的国际化支持还是很薄弱,在LaszloSystem的在线技术论坛中这个区域的问题在2003年已经有人提出来了,但到现在2005年了还一直未予以处理,导致技术论坛上还有人骂LaszloSystem的开发团队不负责任。

测试环境配置:

PIII 667  384M

Windows2000 Server SP4

JDK 5.0

Tomcat 5.54

LPS 3.0b1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: