开发者

Using a GWT app - Is there a workaround to enable IE8 to properly process/render a base64 image url that is longer than 32k?

"Question: Using a GWT app - Is there a workaround to enable IE8 to properly process/render a base64 image url that is longer than 32k? --What is another to get a requested image to a GWT client?"

Hi...

I'm using java6, GWT, IE8.

I have to download photos from a database on request to a GWT web application client page for viewing.

I'd begun using the "Image" object and adding to a SimplePanel on the client page.

Generally the code to do this looks like this... - - -

    AsyncCallback<String> asyncCallback = new AsyncCallback<String>()
    {
        @Override
        public void onFailure(Throwable caught)
        {
        }

        @Override
        public void onSuccess(String base64Url)
        {
            imagePanel.clear();
            imagePanel.add(new Image(base64Url));
        }
    };
   service.getBase64ImageUrl(searchValueMap, asyncCallback);

   -
   -开发者_运维知识库
   -

This works using FireFox... But, it appears as if IE8 will only permit URL strings up to 32K in length. Unfortunately, my app must be compatible with IE8.

The result is that base64 image strings greater than 32K will only partially render... which is not acceptable.

Is there alternative way of getting images larger than 32k to the client that will work around this length restriction issue in IE8? What other means could I use to do this using GWT?

Thanks for any help.

sd


AFAIK there is no workaround for IE8 32k URL size limit.

In your case you could just load the Image directly without GWT-RPC

new Image("/urlOfYourImageServlet?param1="+param1+"&param2="+param2);

(if your param1 or param2 contain some funky characters you'll need to URL encode them)

On the server side provide a servlet that serves images. Just pass some parameters to it so that it can decide what image to serve.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜