HTTPS页面未加载到BrowserContent上 [英] HTTPS page not loaded on BrowserContent

查看:106
本文介绍了HTTPS页面未加载到BrowserContent上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的应用程序中实现嵌入式浏览器,并且由于它必须与OS 4.0兼容,因此

I am implementing an embedded browser in my app, and because it has to be compatible with OS 4.0, BrowserContent is my only choice.

打开HTTPS页面时,屏幕为空白,但是当

When opening a HTTPS page the screen is blank, but this problem doesn't occur when a BrowserSession is used. So I put a println after the BrowserContent part, and it doesn't show up in the console output. So I think this is something wrong with that.

class BrowserScreen extends MainScreen {
    private RenderingSession _renderingSession;
    private HttpsConnection _connection;

    public BrowserScreen(String url) {
        _renderingSession = RenderingSession.getNewInstance();
        final String _url = url;

        new Thread() {
            public void run() {
                try {
                    _connection = 
                        (HttpsConnection)Connector.open(_url, Connector.READ, true);
                    BrowserContent content = 
                        _renderingSession.getBrowserContent(_connection, null, 0);
                    content.finishLoading();
                    Field field = content.getDisplayableContent();

                    synchronized (UiApplication.getEventLock()) {  
                        add(field);
                    }
                } catch (Exception  e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }
}

推荐答案

示例中存在错误,并且BB人员多年来在这方面没有做任何事情.您将自己全部重定向到调用页面.当他们无法呈现页面时,他们在HTTP响应中插入重定向代码,而不是给出呈现异常(在输入流中检出并将其转换为字符串,您会知道的),而预期的页面则永远不会显示.他们已经在5.0和更高版本中使用BrowserField解决了这一问题,但我们需要针对低端移动设备的解决方案.

There is a bug in the sample, and the BB people have done nothing in this regards for years.. You will never know that your page is not rendered and you will be redirected to the calling page all by itself. When they are unable to render the page they insert a redirection code in the HTTP response instead of giving a render exception (check it out in the inputstream and convert it into string and you shall know), and the intended page is never shown. They have resolved this in 5.0 and higher using BrowserField, but we need solution for the low end mobiles.

这篇关于HTTPS页面未加载到BrowserContent上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆