Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 17
Registered: ‎07-28-2010
My Device: Not Specified

Requesting a servlet for an xml file as a response in Blackberry?

Using Httpconnection i want to send the login details as data with the request and once verified i need a xml file as a response which is used in my Blackberry device to display the details (I already implemented this and tested with an xml file)


private void fetchPage(String url) {
// Perform basic validation (set characters to lowercase and add http:// or https://).
boolean validHeader = false;
int i = 0;
for (i = HTTP_PROTOCOL.length - 1; i >= 0; --i) {
if (-1 != url.indexOf(HTTP_PROTOCOL[i])) {
= true;
if (!validHeader) {
// Prepend the protocol specifier if it is missing.
= HTTP_PROTOCOL[0] + url;
// Create a new thread for connection operations.
System.out.println("+++++++url : " + url);

Thanx in Advance ..
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Requesting a servlet for an xml file as a response in Blackberry?

What type of authentication are you using?  If it is HTTP basic, have a look here:


Implement basic HTTP authentication


Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker