This discussion is archived
5 Replies Latest reply: Feb 24, 2013 11:10 AM by jsmith RSS

how to set javafx browser  Accept-Language

987955 Newbie
Currently Being Moderated
Dear all:
I need Visit the facebook in Japanese,but use javafx browser to Visit it ,it display in english.how to set javafx browser Accept-Language?Is there any way to solve the problem?
I need your help, thank you!

Edited by: user13522551 on 2013-2-18 上午2:02
  • 1. Re: how to set javafx browser  Accept-Language
    e-dubkendo Newbie
    Currently Being Moderated
    I think you can figure out how to do it using the information from this Stack Overflow question: http://stackoverflow.com/questions/14385233/setting-a-cookie-using-javafxs-webengine-webview
  • 2. Re: how to set javafx browser  Accept-Language
    987955 Newbie
    Currently Being Moderated
    I try to write code like link,but it can not work.Is there any code to show how to set javafx browser Accept-Language?
  • 3. Re: how to set javafx browser  Accept-Language
    jsmith Guru
    Currently Being Moderated
    Is there any code to show how to set javafx browser Accept-Language?
    No

    File a feature request against the Runtime project at: http://javafx-jira.kenai.com
  • 4. Re: how to set javafx browser  Accept-Language
    987955 Newbie
    Currently Being Moderated
    File a feature request against the Runtime project at: http://javafx-jira.kenai.com


    what is this mean?I don't understood clearly.I can ask a question at http://javafx-jira.kenai.com? I can't find answer about my problem at http://javafx-jira.kenai.com.

    can you tell me clearly?I need help, thank you very much!
  • 5. Re: how to set javafx browser  Accept-Language
    jsmith Guru
    Currently Being Moderated
    I see that a feature request was filed as below:
    http://javafx-jira.kenai.com/browse/RT-28480 "javafx browser set Accept-Language"

    This means that a request has been made to include this functionality in the JavaFX platform. Based on this, the JavaFX team may add a property for the accept language to the WebEngine interface (similar to the ability that was added to set the user agent: http://javafx-jira.kenai.com/browse/RT-22153). I think that would be the best solution. The JavaFX team may not do anything and just close the issue if they feel existing functionality is sufficient or such a feature is unwarranted. Even if a platform change is made it will take a while to be implemented and released.

    In the meantime, you can follow the suggestion of Peter Z in the Jira request comments of:
    You'll probably need a custom URLStreamHandler that would set Accept-Language for HTTP connections it creates.
    For a sample of using a custom URLConnectionHandler, see:

    http://stackoverflow.com/questions/12524580/disable-automatic-image-loading-in-webview
    URL.setURLStreamHandlerFactory(new HandlerFactory());
    Read up on the accept language header in the http specification and read the URLConnectionHandler documentation , and in your custom handler, set the http header for accept language as appropriate.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points