This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes Opening a new JSF/JSP page in a new browser tab Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Opening a new JSF/JSP page in a new browser tab" Watch "Opening a new JSF/JSP page in a new browser tab" New topic
Author

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

John Killman
Greenhorn

Joined: Aug 05, 2010
Posts: 7
(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

Joined: Jan 10, 2002
Posts: 60077
    
  65

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening a new JSF/JSP page in a new browser tab
 
Similar Threads
JSP Custom Tags through XSL
JSF tags
jsp:param not working inside jsp:include and JSF
new to JSTL
Not able to access JSTL tags