0

I was referring below url for the approach Opening an URL from java

I have deployed my code in one of the tomcat server. I used the above code to open a new tab using java.

New tab is opening in the deployed server instead of local machine. We are not able to see whether new tab is opened when we use the applications.

Is there any options to specify the machine name as a parameter or how to open a new tab where the user is accessing the applicaton

2 Answers2

2

Let Tomcat to serve a page that opens a new tab, probably using JavaScript.

window.open()

Does the trick.

defectus
  • 1,947
  • 2
  • 16
  • 21
0

Usually Runtime.exec() will run a process in local machine. As your code is running on server, it is opening new Tab in the server.

To make it to open at client, you need to run javascript code, however, not the Runtime.exec(). You need to use window.open() method, which run in the browser and opens a new tab for you.

Also, you need to make sure <Open new windows in a new tab instead> proeprty is set in the browser. otherwise, it opens a new windows instead of new Tab.

Pavan Kumar K
  • 1,360
  • 9
  • 11