| Author |
Best way to open new browser window - HTTP request in java or webpage
|
Karina Guenther
Ranch Hand
Joined: Sep 16, 2005
Posts: 38
|
|
I have a web page that based upon the users actions, submits a request to a servelet. The servelet uses a properties file and what the user selected to build a url. I need to now open a new browser tab / window using that url. I could perform these actions on the web page, but I'm not sure which is best or exactly how to do it in java.
I've learned about using URLConnection, but I'm not sure what to return so that the new page is opened. The Url is to a page from a different app running on a different server.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
|
You can't force a new window to open from the server. You need to do it on the client when the request is made.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Karina Guenther
Ranch Hand
Joined: Sep 16, 2005
Posts: 38
|
|
|
Thanks - that answers that question, so now I need to figure out how to feed my velocity values into javascript so that I can build the url and open my new window. I know js, but am new to velocity
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16482
|
|
|
Yes, that's right. Just a hint: first design the Javascript you want to see, then figure out how to produce that Javascript. I know that might sound obvious but it's amazing (based on the posts I see here) how many people don't do it that way.
|
 |
 |
|
|
subject: Best way to open new browser window - HTTP request in java or webpage
|
|
|