BlackBerry Forums Support Community
              

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

Please Login to Remove!

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.
Offline  
Old 05-09-2008, 11:18 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

But it's not a valid URL.
Offline  
Old 05-12-2008, 02:42 PM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

look here for displaying raw HTML:
How To - Invoke the browser with raw HTML
Offline  
Closed Thread


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

GE Ultrasound Probe Connector C364 2259249 3.3/D2.5MHz Logiq 400 500 Transducer
$49.99
GE Ultrasound Probe Connector C364 2259249 3.3/D2.5MHz Logiq 400 500 Transducer pictureAmetek Gemco Semelex II Safetimeter + AutoHand + POS/VEL Transducer PN SD0500400
$749.99
Ametek Gemco Semelex II Safetimeter + AutoHand + POS/VEL Transducer PN SD0500400 pictureLot of 6 Setra 264 DPT2641-0R1B-A Low Differential Pressure Transducer Sensor
$120.0
Lot of 6 Setra 264 DPT2641-0R1B-A Low Differential Pressure Transducer Sensor  pictureBARKSDALE 425X-04 PRESSURE TRANSDUCER 0-100 PSIG *NEW IN BOX*
$607.0
BARKSDALE 425X-04 PRESSURE TRANSDUCER 0-100 PSIG *NEW IN BOX* pictureGE COROMETRICS NAUTILUS ULTRASOUND TRANSDUCER 5700HAX
$251.0
GE COROMETRICS NAUTILUS ULTRASOUND TRANSDUCER 5700HAX picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.