Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening a new JSF/JSP page in a new browser tab

 
John Killman
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Old to Java, new to JSF/JSP)

We have a set of JSF/JSP pages. One is a table of items, which is successfully being displayed in a browser window.
We would like to click on one of the items have a details page open in a new tab without closing the source tab.

We have no problem getting the item ID. We are having a problem opening the related details page in a separate tab within the current browser window (response.sendRedirect and requestDispatcher.forward open over the current window).

We are using JSF/JSP (and Gantt Charts, but not really relevent).
If possible, we do not want new Javascript, only JSF/JSP and backend Java.

We know for HTTP we would use something like:
<A HREF="newwindow.html" TARGET="_blank">a new window</A>

We have tried things like:
<%@ page language="java" %>
<%@ taglib uri="<a href="http://java.sun.com/jsf/html" target="_blank" ...
<%@ taglib uri="<a href="http://java.sun.com/jsf/core" target="_blank" ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
...

Much time has been spent - I guess we are searching on the wrong keywords. Any help would be appreciated.

Thanks,
John
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Killman wrote:We know for HTTP we would use something like:
<A HREF="newwindow.html" TARGET="_blank">a new window</A>

Do you mean HTML (not HTTP)? And yup, that's the way you do it. Remember that all JSP or JSF does is to format HTML to send to the browser.

We have tried things like:
<%@ page language="java" %>
<%@ taglib uri="<a href="http://java.sun.com/jsf/html" target="_blank" ...
<%@ taglib uri="<a href="http://java.sun.com/jsf/core" target="_blank" ...

What did you think such a taglib declaration would do?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic