How to invoke a browser from an Application button  with a specified URL

Hi
I am trying to invoke a browser by clicking a button on my Application .I want the browser to come up with the URL I decide before i click on the button.
To invoke the browser i am using the Runtime class. and then using the Runtime.exec() method .
But thats only half the solution.(Loading a specific URL decided at runtime is a problem)
Is there a way out ??
Thanks
Pranav

Hi there,
You have already reach to solution, just specify parameter as your URL to iexplore.exe in Runtime.exec() command.
Like if you running from command prompt , it will look like something below
C:>directory where iexplore is>iexplore java.sun.com
for java Runtime.exec("iexplore.exe","java.sun.com");
hope it will help you out,
Dhwanit Shah

Similar Messages

  • How to invoke a servlet from an application-URGENT

    Hi,
              My requirement is as follows :
              I have to invoke a servlet from a client application. I am using
              java.net.URL and java.netURLConnection classes to
              open a connection and invoke the servlet.
              I am using WebLogic5.1
              my code snippet is as follows :
              URL url = new URL("http://localhost:7001/urlservlet");
              URLConnection connection = url.openConnection();
              connection.setRequestMethod("GET");
              connection.setDoOutput(true);
              connection.setDoInput(true);
              PrintStream outStream = new PrintStream( connection.getOutputStream() );
              outStream.print("message=hai");
              outStream.flush();
              outStream.close();
              When I execute the application, Webloigc server console is displaying the
              following line.
              <Listen Thread> Adding Address : <machine name><ip address>
              But the service method of servlet is not getting invoked at all.
              Help me to find the answer.
              Jeelani
              

    jeelani <[email protected]> wrote:
              > Hi Dimitri,
              > Thanks a lot.That worked for me.
              > But if I want to send java objects (Vectors,beans),what is the best way to
              > do it.
              > This is exactly what our requirement is..
              If you want to send Java object you have to use POST:
              URLConnection conn = ...
              conn.setDoOutput(true); // makes this a POST
              OutputStream os = conn.getOutputStream();
              ...write your objects here...
              os.flush();
              os.close();
              InputStream in = conn.getInputStream(); // sends data to the server and
              // opens input stream
              ..read servlet response..
              .. ot just close the stream...
              in.close();
              > my client application need to send some java components to our main server
              > located in our head office.The servlet will read the objects and execute the
              > functionality..
              > I really appreciate for the fast response from you.
              > Dimitri Rakitine <[email protected]> wrote in message
              > news:[email protected]...
              >> Try it like this:
              >>
              >> URL url = new URL("http://localhost:7001/urlservlet?message=hai");
              >> URLConnection connection = url.openConnection();
              >> InputStream in = connection.getInputStream();
              >> in.close();
              >>
              >>
              >> jeelani <[email protected]> wrote:
              >> > Thanks for the quick response.
              >>
              >> > Actually right now it doesn't matter whether it is by GET or by POST.
              >> > Add my clinet application just needs to send data to Servlet and nothing
              > to
              >> > get in return.Thats why I am using connection.getOutputStream().
              >>
              >> > since application will not be reading anything from servlet, I don't
              >> > think it is required to use connection.getInputStream().
              >> > (I am sorry, if I am wrong).
              >>
              >> > Can you please help me out. weblogic server is able to get the address
              >> > from where the request is coming. Only problem is servlet is not getting
              >> > invoked.
              >>
              >> > regards,
              >> > Jeelani
              >>
              >>
              >> > Dimitri Rakitine <[email protected]> wrote in message
              >> > news:[email protected]...
              >> >> Are you trying to do get or post? First you set method to GET
              >> >> and then you do the POST.
              >> >>
              >> >> And add InputStream is = connection.getInputStream() - that will
              >> >> result in HttpURLConnection sending data to the server and getting
              >> >> back the response.
              >> >>
              >> >> jeelani <[email protected]> wrote:
              >> >> > Hi,
              >> >>
              >> >> > My requirement is as follows :
              >> >>
              >> >> > I have to invoke a servlet from a client application. I am using
              >> >> > java.net.URL and java.netURLConnection classes to
              >> >> > open a connection and invoke the servlet.
              >> >>
              >> >> > I am using WebLogic5.1
              >> >>
              >> >> > my code snippet is as follows :
              >> >>
              >> >> > URL url = new URL("http://localhost:7001/urlservlet");
              >> >>
              >> >> > URLConnection connection = url.openConnection();
              >> >>
              >> >> > connection.setRequestMethod("GET");
              >> >> > connection.setDoOutput(true);
              >>
              >> >> > PrintStream outStream = new
              >> > PrintStream( connection.getOutputStream() );
              >> >> > outStream.print("message=hai");
              >> >> > outStream.flush();
              >> >> > outStream.close();
              >> >>
              >> >> > When I execute the application, Webloigc server console is displaying
              >> > the
              >> >> > following line.
              >> >>
              >> >> > <Listen Thread> Adding Address : <machine name><ip address>
              >> >>
              >> >> > But the service method of servlet is not getting invoked at all.
              >> >>
              >> >> > Help me to find the answer.
              >> >>
              >> >> > Jeelani
              >> >>
              >> >> --
              >> >> Dimitri
              >> >> http://dima.dhs.org
              >>
              >>
              >>
              >> --
              >> Dimitri
              >> http://dima.dhs.org
              Dimitri
              http://dima.dhs.org
              

  • How to close the browser from webdynpro application

    Hi All,
    I need  to implement the closing the browser where the webdynpro  application running by click on some button in that application.
    Can any body tell me how to implement that.
    Regards
    Vijay

    Hi,
    I resolved as follows(WebDynpro7.3) :
    1.- Create a plug in the "Window" with the name "Exit" and parameter "closeWindow" the type Boolean, after edit it and put type Exit.
    2.-Repeat the same but in the "Interface".
    3.-Place the following code in the action:
      IWDWindowController iwdWindowController =wdControllerAPI.getWindowController();
      IWDWindowInfo windowInfo=iwdWindowController.getWindowInfo();
      IWDOutboundPlugInfo  iwdOutboundPlugInfo=windowInfo.findInOutboundPlugs("Exit");
      iwdWindowController.firePlug(iwdOutboundPlugInfo, new HashMap(){{put("closeWindow",true);}});
    regards.
    JCARMONA

  • How can we lauch browser from my application?

    hello all,
    i tried
    Runtime.getRuntime().exec("cmd /c start http://www.sun.com");
    to launch my default browser (IE) on NT4 system,
    but nothing happened...
    when i tried Runtime.getRuntime().exec("iexplore.exe")
    i got
    java.io.IOException: CreateProcess: iexplore.exe error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Compiled Code)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Compiled Code)
    at java.lang.Runtime.exec(Compiled Code)
    at java.lang.Runtime.exec(Runtime.java:152)
    at Launch.main(Launch.java:6)
    i tried Runtime.getRuntime().exec("start http://www.sun.com") eventhough it is meant for win95..
    thanks in advance...
    Regards
    Sojan

    hi,
    when i tried as
    Runtime.getRuntime().exec("start http://www.yahoo.com");
    [ i heard that this is for win95 ]
    i got the following exception.. i'm using WinNT-4 and IE5.0 ,
    java.io.IOException: CreateProcess: start http://www.yahoo.com error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:64)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:272)
    at java.lang.Runtime.exec(Runtime.java:195)
    at java.lang.Runtime.exec(Runtime.java:152)
    at LaunchBrowser.main(LaunchBrowser.java:6)
    can anyone suggest a method which works on NT?

  • How do i  open browser in java application

    hi....
    please help me!!!!!!!!!!!!!!!!!!!!!!!!!!
    how do i open browser in java application ? ( for show javascript in java application)
    thank you.......

    You can run any program from java by doing
    Runtime.getRuntime().exec("mybrowser myjavascriptfile.js");
    The real question is why would you want to.
    I would suggest you rethink whether running Javascript from Java is a good idea.

  • How to invoke a servlet from MDB

    Hi,
    Can someone please tell me how to invoke a servlet from MDB. Actually I want to have a MDB that will invoke a servlet that takes arround ~3 minutes to process and send the response back to MDB. Any small code snippet on invoking a servlet.
    Thanks

    nope. this is probably a bad design.
    but here's a hint: whenever you have a question like this, start browsing the javadocs. chances are there's a class that might help you.
    i'd recommend that you look at this:
    http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html
    %

  • How to make data flow from one application to other in BPEL.

    Hi All,
    I am designing work-flow of my application through BPEL(JDeveloper), I am making different BPEL projects for different functions, like sales manager got the order from sales person and sales manager either approve it or reject it, if he approve it it goes to Production manager and he ships the goods, now I want to keep sales person, sales manger,production manager in seperate BPEL files and want to get the output of sales person to sales manager and sales manager to production manager please help me in dong this.
    I was trying to make partner link in Sales manager of sales person and getting the input from there. I dont know this is right even or not, if it is right I dont know how to make data flow from one application to other.
    Experience people please guide.
    Sales Person -----> Sales Manager ----> Production Manager
    Thanks
    Yatan

    Yes you can do this.
    If you each integration point to be in different process, you have to create three BPEL process.
    1. Create a Async BPEL process 'A' which will be initiated when sales person creates the order.
    2. From BPEL process 'A' call a ASync BPEL process 'B' which has the approval flow. Depending on the input from process 'A' the sales manager will review the order in workflow and approve or reject and send the result back to process 'A'.
    3. Based on the result from workflow, invoke the Sync BPEL process 'C', where you can implement the shipping logic.
    -Ramana.

  • Question on "How-to invoke a method once upon application start"

    Hello everyone.
    I'm trying to implement what the article "How-to invoke a method once upon application start" by Frank suggests.
    https://blogs.oracle.com/jdevotnharvest/entry/how_to_invoke_a_method
    Suppose that I'm having a single point of entry, so in my login.jpsx I have the below:
    <f:view beforePhase="#{login.onBeforePhase}">In the method "onBeforePhase" I have to pass the phaseEvent, since the signature is the following:
    public void onBeforePhase(PhaseEvent phaseEvent)but how do I know the phaseEvent when calling the login.onBeforePhase? How the call should be?
    Thanks a lot!
    ps. I'm using jDev 11.1.2.1.0

    You need not pass anything to this method , this method will get called before every Phase except ReStore View
    Just write the logic as Frank suggested for the phase in which you want the code to execute. You can get the PhaseId's like
    PhaseId.RENDER_RESPONSE
    public void onBeforePhase(PhaseEvent phaseEvent) {// from Frank's doc
    //render response is called on an initial page request
      if(phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE){
    ... etc

  • How to stop the Browser from caching my web pages

    Hi There
    Can anyone tell how to stop the browser from caching my jsp pages
    I am using
    <%response.setHeader("Cache-Control","no-cache");
    response.setHeader("Pragma","no-cache");
    response.setDateHeader ("Expires", 0);
    %>
    but this does not work anduser is able to go back to the previous page
    which i dont want and i want the browser to display the message the page has expired
    Help appreciated
    Thanks
    Mumtaz

    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
    I have cut paste the code from my jsp which is working. There is one additional line. I do not know if that is the cause but there is no harm in trying that out.
    Srinivasan Ranganathan

  • How to invoke crystal reports from Oracle forms 11g R2 along with passing p

    How to invoke crystal reports from Oracle forms 11g R2 along with passing parameter to it.
    how to pass parameters to crystal report, please help.

    how to pass parameters to crystal report, please help.This would entirely depend on crystal reports and you might find informations on crystal reports related communities more likely...I for one have seen crystal reports the last time about 12 years ago. And even back then I simply acknowledged it's existence instead of working with it.
    Maybe crystal reports can be invoked via a URL call which would make it simple as you'd need simply build an URL and show the report using web.show_document. But that's pure speculation. Also you might not be the first with this requirement, so the solution to your problem might be right under your nose and just a little google search away ;)
    cheers

  • How to invoke business process from sap xi?

    Hi...
    Please tell "How to invoke business process from SAP UI's."

    Hi...
    How to invoke business process from SAP UI's. (Eg: To trigger a process after creating an invoice)

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

  • How to invoke safari browser through code?

    how to invoke safari browser through code?

    Hi Sam,
    Please check if the articles below can be help:
    http://www.bizsupportonline.net/browserforms/programmatically-submit-infopath-form-sharepoint-send-email-close-form.htm
    http://www.bizsupportonline.net/blog/2009/01/how-to-programmatically-run-code-close-infopath-web-form/
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How to send sms port from Desktop applications to the Midlet?

    how to send sms port from Desktop applications to the Midlet?

    Depends on the API your SMS gateway provides, and may not even be possible. Even if you can send the SMS with a port specified, be aware that some carriers deliver the SMS without the port number, which will result in it going to the device inbox and so won't activate your MIDlet registered with the PushRegistry.
    I understand that you're working on a JavaSE application, but members who frequent the mobility forums might have more knowledge about this. Would you like me to move this thread there?
    db

  • How do i get contacts from iphone to merge with outlook contacts

    how do i get contacts from iphone to merge with outlook contacts

    If Outlook already has a munch of contacts, do I need to delete them all (all but 1 unique) to sync correctly?
    I have and iPhone ith up to date contacts, and I have outlook with some of the same contacts with older info. When I sync, outlook is OK, but I get a lot of copies of the same contact on my iPhone. Now I'm not entirely sure which are the up-to-date contacts and which aren't (and there's hundred of contacts to go through).
    ...For future reference, is there a way to to send the iPhone contacts to Outlook without adding crap to my phone? Amidst the sync process I noticed and option for conflicting files and choose the "always use phone" but still wound up with a contact mess of mixed old and new on the phone.

Maybe you are looking for

  • Adobe Bridge CC -- ongoing problems with Photo Downloader (scrolling, crashing, etc)

    Hello Community, Thanks in advance for any suggestions to improve my Bridge CC experience! I have recurring problems, esp. when using the Photo Downloader (in other words, daily problems) -- scrolling either up or down to select photos is a nightmare

  • BAPI to get the Purchase Order Details

    Hi Folks, Which BAPI is used for retriving the details of a particulare Purchase Order? Please also mention how the same is used? Sample code will be helpful. Thanks Siddarth

  • Possible bug with TREAT and EXECUTE IMMEDIATE

    Hello, i experienced a strange behavior which seems to be a bug. Consider following definitions: CREATE OR REPLACE TYPE T_Base FORCE AS OBJECT (   DummyProperty NUMBER ) NOT FINAL; CREATE OR REPLACE TYPE T_Child UNDER T_Base (   AnotherDummyProperty 

  • Composite primary key and InputSelect

    Hi I have a jsp page where I have an InputSelect list that display the on of the field of a composite primary key. What I what is to pass the second field of the primary key to my submit page without letting the user see that field. <tr> <td>Projekt<

  • E N A B L E R - -  W A N T E D ! ! !

    Okay, how do we get the precious 802.11n Enabler? I'm looking forward to installing it.