質問

I am new to blackberry. I want how to authentication in browserfield

    BrowserField web;
    String Usname="yahoo@yahoo.com";
    String password="123456788";        
    setTitle("sample");
    String Welcome ="example@example.com/isloginmethod.aspx";
    String logindata ="LoginID="+Usname+"&Password="+password;
    byte[] encodeLogin =Base64OutputStream.encode(logindata.getBytes(),0,logindata.length(), false, false);
    BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
    myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
    web = new BrowserField(myBrowserFieldConfig);
    add(web);
    web.requestContent(Welcome,encodeLogin,null);
役に立ちましたか?

解決

The web.requestContent method you've used here is for calling the url/posting the data and not for authentication.

HTTP Authentication does not come standard in the BrowserField2 API. You'll have to implement ProtocolHandler and override it for doing authentication.

Check this :

http://208.74.204.192/t5/Java-Development/How-to-enable-HTTP-Authentication-in-your-BrowserField2/ta-p/623025

This will help you implement that.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top