我有一個帶有jsf庫的some.xhtml文件。在<h:body>
標籤,我想顯示2個字:使用JBoss v4.2.1 Facelets解析問題
這是第一個我使用純文本:你好
對於第二個我用:<h:outputText value=" there"/>
我希望看到「你好」,但只有你好打印在頁面上。所以我認爲在JBoss 4.2.1中不會對facelet進行解析。它運行了Apache 7.我該如何解決它。可能是一些必須添加到web.xml
或faces-config.xml
文件?
在此先感謝
附:我打開網頁是這樣的:http://localhost:8080/ProjectName/faces/some.xhtml
some.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title>Title that rocks</title>
</h:head>
<h:body>
Hello
<h:outputText value=" there" />
</h:body>
</html>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
</faces-config>
這與JSTL完全無關。我編輯了你的問題和標籤。 JSTL是一個JSP標準標籤庫,它是那些''標籤等等。另請參閱http://download.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/您實際上是指「JSF標籤」或「Facelets標籤」,而不是「Facelets JSTL」。 –
BalusC