工作,我有一個JSF XHTML頁面window.location.href不JSF
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<head>
<f:loadBundle basename="myProperties" var="msg" />
</head>
<f:view>
<body>
<h:form method="post" name="redirectForm"
id="redirectId">
<div>
<br />
<table width="100%" border="0" align="center">
<tr>
<td align="center" width="100%" class="style1">Please wait.
The page is getting loaded...</td>
</tr>
</table>
<input type="hidden" name="msg" value="#{myBean.transMsg}" />
<input type="hidden" id="pgURLId" name="pgurl" value="#{myBean.pgURL}" />
</div>
</h:form>
<script type="text/javascript">
/* <![CDATA[ */
function forward() {
var pgUrlId=getElementForAnId('pgURLId');
var pgValue=document.getElementById(pgUrlId).value;
var formId=getElementForAnId('redirectId');
document.getElementById(formId).action = pgValue;
document.getElementById(formId).submit();
window.location.href = pgValue;
}
forward();
function getElementForAnId(str) // To removing appending content
{
var ret;
var inputs = document.getElementsByTagName('*');
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].id.indexOf(str) != -1) {
ret = inputs[i].id;
}
}
return ret;
}
/* ]]> */
</script>
</body>
</f:view>
</html>
我使用的Liferay門戶 - 6.0.6和jboss-5.1.0
我能擊中那個pgurl但味精沒有被張貼。
當我在我的日誌中看到它時,收到的消息爲空。