BlackBerryForums.com : Your Number One BlackBerry Community  
   

»Sponsored Links




Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
ahmadgee Offline
Thumbs Must Hurt
 
Posts: 51
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: do not know
Default HTTP Error 400:Bad Request - 05-09-2008, 09:39 AM

Hi every body,

I have writen the code the display the contents of html string using BrowserSession in simulator But I got the following error

HTTP Error 400:Bad Request
The server could not understand the page request, or was unable to process it for some reasons. Please try loading a different page.

Please help me to correct this error.
Code:
public class WebLauncher1 extends UiApplication
{    
    public static void main(String[] args)
    {
        WebLauncher1 theApp = new WebLauncher1();
        theApp.enterEventDispatcher();
    }

    public WebLauncher1()
    {
        BrowserSession browserSession = Browser.getDefaultSession();
        String htmlString="<h1>My First Heading </h1>";
        browserSession.displayPage(htmlString);
        System.exit(0);
    }    
}

Last edited by ahmadgee : 05-09-2008 at 09:40 AM.
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
goulamass Offline
Thumbs Must Hurt
 
Posts: 124
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Default 05-09-2008, 11:18 AM

In fact your program try to connect to the url given by htmlString.

But it's not a valid URL.
   
Reply With Quote
  (#3 (permalink)) Old
Ivanov Offline
Thumbs Must Hurt
 
Posts: 113
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Default 05-12-2008, 02:42 PM

look here for displaying raw HTML:
How To - Invoke the browser with raw HTML
   
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1