Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looking at the generated JavaScript function, you're using Sun Mojarra as JSF implementation (please mention that with more detail in the future, you could for instance also have used Apache MyFaces). </p> <p>I just tried the following <a href="http://sscce.org" rel="nofollow noreferrer">SSCCE</a> on Tomcat 6.0.20 with Mojarra 1.2_14:</p> <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%&gt; &lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;f:view&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;SO question 2111438&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h:form id="form"&gt; &lt;h:commandLink id="link" value="link" action="#{bean.action}" target="_blank"&gt; &lt;f:param name="paramname" value="paramvalue" /&gt; &lt;/h:commandLink&gt; &lt;/h:form&gt; &lt;/body&gt; &lt;/html&gt; &lt;/f:view&gt; </code></pre> <p>...with a dummy action method on a request scoped bean and it just works flawlessly on Chrome 3.0.195.38. </p> <p>I however recall similar JavaScript problem with Safari which has been fixed about around Mojarra 1.2_08. Ensure that you're using the latest Mojarra version. You can get it at their <a href="http://javaserverfaces.dev.java.net" rel="nofollow noreferrer">main dev site</a>. Hope this helps.</p> <p>The full generated HTML source was by the way (slightly reformatted):</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;SO question 2111438&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form" name="form" method="post" action="/playground/test.jsf" enctype="application/x-www-form-urlencoded"&gt; &lt;input type="hidden" name="form" value="form" /&gt; &lt;script type="text/javascript" language="Javascript"&gt;function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i &lt; adp.length;i++) {f.removeChild(adp[i]);}}};function apf(f, pvp) {var adp = new Array();f.adp = adp;var i = 0;for (k in pvp) {var p = document.createElement("input");p.type = "hidden";p.name = k;p.value = pvp[k];f.appendChild(p);adp[i++] = p;}};function jsfcljs(f, pvp, t) {apf(f, pvp);var ft = f.target;if (t) {f.target = t;}f.submit();f.target = ft;dpf(f);};&lt;/script&gt; &lt;a id="form:link" href="#" onclick="if(typeof jsfcljs == 'function'){jsfcljs(document.getElementById('form'),{'form:link':'form:link','paramname':'paramvalue'},'_blank');}return false"&gt;link&lt;/a&gt;&lt;input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id8:j_id9" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload