×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    3

    How to detect if the phone is now supporting xhtml or wml?

    hi,

    How to detect if the phone is now supporting xhtml or wml?
    I'm creating a wap application. Since some of the phone only support wml, I have created 2 sets of wap pages with their files separated in 2 subfolders.
    Therefore when a wap user access/enter my wap apps, my apps should be able to auto-detect the user's phone supported-language and make an auto redirect so that the user can see the proper page.

    How?


    Thanks,
    yukeshean

  2. #2
    Registered User
    Join Date
    May 2004
    Posts
    7

    just an idea

    u could detect the capability to display xhtml by checking the accept header of the client. if it includes the type 'application/xhtml+xml' - bingo.

    ofcourse i'm assuming the 'app' runs serverside...

    another way would be to work with CC/PP /UAPROF, these are xml-files stored on a server describing the device capabilities of the most phones in a detailed manner.

    regards,

    S.

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    3
    How to detect the capability to display xhtml by checking the accept header of the client by type 'application/xhtml+xml' ? Please show me some example on how to?
    FYI, All my pages are in jsp and save in .jsp file type.

    Anyway is it needed to build 2 sets of code of xhtml and wml tag for the same apps? I just do not see much difference when i tested my pages in the nokia 3300 SDK. Is form-posting supported in wml pages?

    Thanks and Rgs,
    yukeshean

  4. #4
    Registered User
    Join Date
    May 2004
    Posts
    7

    sorry..

    can't give no real-life examples, 'cause i didn't do it yet using jsp.

    but like other languages java provides means to access the http header of a http-request.

    the request is sent from a wap/xhtml browser, which tells the server what type of content it understands by sending a accept header. so the browser says 'i'm capable of displaying content types like...'.

    Now what u do serverside is examine the http header, specifically the 'accept' section. if it got the string 'xhtml' in it, you route to the xhtml file, if i doesn'n contain 'xhtml', route to the wml file.

    yes you have to do to sets of pages ( unless you use a sophisticated transcoding mechanism to automatically render pages upon a xml basis...this involves serverside XSLT )
    that's because wml and (x)html are quite different in document organization and features. if u want to take advantage of the xhtml features, u must tell the client ( and the gateway ) exactly what content-type to expect.

    so make sure you send a header containing the right mime-type like "Content-type: application/xhtml+xml"
    or
    "Content-type: text/vnd.wap.wml"
    in your jsp files.

    *S*

Posting Permissions

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