How to redirect to URL in Java?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Brandon
    New Member
    • Mar 2012
    • 2

    How to redirect to URL in Java?

    hello everyone ,

    Can anyone please tell me how to redirect to URL from a Java class 'not a servlet'.

    I mean lets say when you execute a java application it automatically opens the browser and redirect you to a specific URL.

    Looking forward to hearing from you soon!

    thanks in advance,

    Sincerely,
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    You can use the Desktop class
    [CODE=java]
    Desktop.getDesk top().browse(ne w URI("www.google .com"));[/CODE]

    Comment

    Working...