Hello!
I have a problem with a form that has commandlinks with target="_blank".
The problem is that sometimes the new window opens with the same page I
am coming from, sometimes it opens the correct new page I have defined
in faces-config.xml. The behaviour is completely random. I tried to have
a target="_blank" on form level and use commandbuttons. But the
behaviour stays the same. So there must be something I am doing wrong.
In the logfile are no exceptions or warnings.
Environment:
* Sun JDK 5.0
* Tomcat 5.5.16
* MyFaces 1.1.1
I attached the JSP for reference.
Thanks for any advice
Thomas
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>displayLogFiles.jsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="../css/log.css">
</head>
<body>
<f:view>
<f:loadBundle basename="logtail.property.messages"
var="msg" />
<h:form id="logfilesform">
<h:dataTable id="logfiles"
value="#{LogfilesBean.logfilesModel}" var="logfile" rowClasses="odd,even"
headerClass="header">
<h:column>
<f:facet name="header">
<h:outputText
value="#{msg.logfile}" />
</f:facet>
<h:outputText
value="#{logfile.absolutePath}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText
value="#{msg.lastmodified}" />
</f:facet>
<h:outputText
value="#{logfile.lastModificationDate}">
<f:convertDateTime
type="both" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText
value="#{msg.actions}" />
</f:facet>
<h:commandLink
action="#{DownloadBean.download}" target="_blank">
<h:graphicImage
value="/images/download.png" alt="#{msg.download}"/>
</h:commandLink>
<h:outputText value=" "
escape="false" />
<h:commandLink
action="#{TailBean.tail}" target="_blank">
<h:graphicImage
value="/images/tail.png" alt="#{msg.tail}"/>
</h:commandLink>
</h:column>
</h:dataTable>
</h:form>
<br>
<h:form id="actionsform">
<h:commandButton
action="#{LogfilesBean.reload}" value="#{msg.reload}" />
<br>
<h:commandButton
action="#{LogfilesBean.logout}" value="#{msg.logout}" />
</h:form>
</f:view>
</body>
</html>