我一直在打我的頭撞在牆上用這一個幾個小時已經和我沒有線索爲什麼會這樣......JSF 1.2在JBoss 6和EL表達式不解決
最近我們有開始從JBoss 4.2.3遷移到JBoss 6 Final。我們正在使用JSF 1.2。我已經成功地將應用程序改編爲新的JBoss(主要是通過從WEB-INF/lib中刪除一些JAR並稍微調整web.xml)並且應用程序啓動得很好。
問題是某些EL表達式沒有被解析,而有些則是。我還在日誌中獲得了0個例外或警告。
我有一個名爲「mapContext」的bean,它在JSF xml配置文件之一中定義。它被創造得很好。在我的JSF頁面我有:
<h:inputHidden id="mapContextId" value="#{mapContext.webContextId}" />
,並在渲染頁面就變成:
<input id="mapForm:mapContextId" type="hidden" name="mapForm:mapContextId" value="#{mapContext.webContextId}" />
正如你所看到的,JSF標籤被渲染得很好,但EL不被解釋。
server.log中沒有指示任何問題的日誌。
JSF 1.2,JSTL 1.2時,JBoss 6,JDK 6
web.xml中:
<context-param>
<param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
<param-value>Mojarra-1.2</param-value>
</context-param>
任何幫助將不勝感激! 拉法爾
更多細節:
嗯,我doublechecked我的代碼和配置。此外,我還向我正在使用的自定義變量解析器添加了一些日誌記錄,以查看JSF使用的bean。結果很奇怪。
所有我已經提高了我的JSF頁面不同的輸出,並且它現在看起來像這樣的第一:
<h:inputHidden id="mapContextId1" value="#{mapContext}" />
<h:inputHidden id="mapContextId2" value="#{selectionPointSymbol.width}" />
<h:inputHidden id="mapContextId" value="#{mapContext.webContextId}" />
<h:inputHidden id="mapContextId3" value="#{selectionPointSymbol4.width}" />
,並呈現爲:
<input type="hidden" name="mapForm" value="mapForm" />
<input id="mapForm:mapContextId1" type="hidden" name="mapForm:mapContextId1" value="#{mapContext}" />
<input id="mapForm:mapContextId2" type="hidden" name="mapForm:mapContextId2" value="#{selectionPointSymbol.width}" />
<input id="mapForm:mapContextId" type="hidden" name="mapForm:mapContextId" value="#{mapContext.webContextId}" />
<input id="mapForm:mapContextId3" type="hidden" name="mapForm:mapContextId3" value="#{selectionPointSymbol4.width}" />
我檢查了日誌,我可以看到那個mapContext被非標準的JSF標籤正好解決:
12:27:24,911 ERROR [mb.ags.adf.resolvers.AGSUserResolver] AGSUserResolver asked to resolve: mapContext
12:27:24,911 ERROR [mb.ags.adf.resolvers.AGSUserResolver] AGSUserResolver delegated to: [email protected] and resulted with: [email protected]
12:27:24,927 ERROR [mb.ags.adf.resolvers.AGSUserResolver] AGSUserResolver asked to resolve: mapContext
12:27:24,927 ERROR [mb.ags.adf.resolvers.AGSUserResolver] AGSUserResolver delegated to: [email protected] and resulted with: [email protected]
(很多人,我日誌)。
但是沒有關於:selectionPointSymbol或selectionPointSymbol4(根本沒有定義這樣的bean)的單一日誌,它們只用於標準標籤。
仍然在服務器日誌中沒有錯誤或警告:(
更多細節:簡單的測試。因爲沒有記錄,說明什麼問題
<html>
<head>
<title>Megabit Mb_GIS WWW</title>
<link rel="stylesheet" title="base" href="/mb_gis_webmap/css/base-style.css" type="text/css" media="screen" />
<style type="text/css">
body { overflow:auto; }
</style>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" language="javascript" src="/mb_gis_webmap/js/prototype.js"></script>
<script type="text/javascript" language="javascript" src="/mb_gis_webmap/js/scriptaculous/scriptaculous.js?load=effects"></script>
<script type="text/javascript" language="javascript" src="/mb_gis_webmap/js/ext/ext-prototype-adapter.js"></script>
<script type="text/javascript" language="javascript" src="/mb_gis_webmap/js/ext/ext-all.js"></script>
<script type="text/javascript" language="javascript" src="/mb_gis_webmap/js/mb_errors.js"></script>
<script type="text/javascript" language="Javascript" src="/mb_gis_webmap/js/esri_core.js"></script>
<script type="text/javascript" language="Javascript" src="/mb_gis_webmap/js/mapviewer.js"></script>
<script type="text/javascript" language="javascript" src="/mb_gis_webmap/js/ExternalClient.js"></script>
<script type="text/javascript" language="Javascript" src="/mb_gis_webmap/js/index_init.js"></script>
</head>
<body>
<!-- tabelka ładowania -->
<div id="loading_table_container" style="position:absolute; text-align:center; left:0; top:0; width:100%; height:100%; z-index:20000; background-color:white;">
<table id="loading" style="z-index:20001;" height="100%" width="100%">
<tr>
<td align="center" valign="middle" style="font-size: 12px">
<img src="/mb_gis_webmap/images/loading_big.gif" alt="Loading..." align="absmiddle"/><br/><br/>
#{msg.welcome_page_map_client_loading}<span id="mapContextId2">#{selectionPointSymbol.width}</span>
</td>
</tr>
</table>
</div>
<!-- tabelka ładowania -->
<script>
var url = "/mb_gis_webmap/mapviewer.jsf?msid=1000005&uid=1&cid=1&mapContextId=1";
var refresh = "<meta http-equiv=\"refresh\" content=\"1000; URL=" + url + "\" />";
document.writeln(refresh);
</script>
</body>
</html>
仍然沒有線索正在發生的事情,:
JSF頁面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page buffer="96kb" autoFlush="true" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:view>
<f:loadBundle basename="mb.ags.res.AGSClient" var="msg"/>
<html>
<head>
<title>*********</title>
<link rel="stylesheet" title="base" href="/mb_gis_webmap/css/base-style.css" type="text/css" media="screen" />
<style type="text/css">
body { overflow:auto; }
</style>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<!-- tabelka ładowania -->
<div id="loading_table_container" style="position:absolute; text-align:center; left:0; top:0; width:100%; height:100%; z-index:20000; background-color:white;">
<table id="loading" style="z-index:20001;" height="100%" width="100%">
<tr>
<td align="center" valign="middle" style="font-size: 12px">
<img src="/mb_gis_webmap/images/loading_big.gif" alt="Loading..." align="absmiddle"/><br/><br/>
<h:outputText value="#{msg.welcome_page_map_client_loading}"/>
<h:outputText id="mapContextId2" value="#{selectionPointSymbol.width}" />
</td>
</tr>
</table>
</div>
<!-- tabelka ładowania -->
<script>
var url = "<%= redirectUrl %>";
var refresh = "<meta http-equiv=\"refresh\" content=\"1000; URL=" + url + "\" />";
document.writeln(refresh);
</script>
</body>
</html>
</f:view>
呈現爲。
哦,男人,非常感謝! web.xml有舊的規格附加,仍然使用2.4! – 2011-05-08 11:37:46
不客氣。 – BalusC 2011-05-08 11:54:56