×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    9

    how to redirect url in j2me

    Actually i need to fetch an image which is not present at the url which i am using in my code.The url which i m using will redirect to a url where the actual image is present.But my j2me application is not able to redirect the url.
    And also ,i cannot use the redirected url in my code because it is different for different ids.So plz tell me the way so that by using the first url only i can fetch the image.

    original url :http://lookup.avatars.yahoo.com/imag...=png&pty=14000

    redirected url:http://us.i1.yimg.com/us.yimg.com/i/...atar_small.png

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,795

    Re: how to redirect url in j2me

    Hello Neha_rashi,

    You have hit the wrong forums !
    If you want to ask questions related to Java (J2ME) you can post it here
    I guess this thread will be moved!

    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    18

    Re: how to redirect url in j2me

    Hi Neha, can you please share the solution if you have found it.. I am looking for something similar... thnx

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: how to redirect url in j2me

    Hi,

    if you need the redirect URL, you should:

    * if response code is 302 (so, it's actually a redirect) [actually, even if 302 is the most widely used, you should check also for other response codes that imply redirection, like 301 or 307]
    * if it is, then you should get the response header "Location"

    So, you should do something like:
    Code:
    conn = (HttpConnection)Connector.open(url);
    			
    if(conn.getResponseCode() == 302)
    {
    	String redirectUrl = conn.getHeaderField("Location");
    }
    Pit

  5. #5
    Registered User
    Join Date
    Jun 2010
    Location
    Chandigarh, India
    Posts
    17

    Re: how to redirect url in j2me

    Thanks buddy..

  6. #6
    Registered User
    Join Date
    Feb 2009
    Posts
    1

    Re: how to redirect url in j2me

    Thank you very much , i was looking for that

Similar Threads

  1. Redirecting url in J2ME
    By neha_rashi in forum Mobile Java General
    Replies: 3
    Last Post: 2008-07-07, 12:53
  2. 6600 j2me emulator url needed
    By sai in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2006-08-08, 23:09
  3. j2me web url message problme
    By kmsoomro in forum Mobile Java General
    Replies: 2
    Last Post: 2005-06-08, 09:11
  4. WAP, WML: dynamic url redirect with app
    By sueggelh in forum Symbian
    Replies: 1
    Last Post: 2005-03-03, 11:50
  5. J2ME Polish Version 1.0 RC6
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-07-20, 11:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×