我正在用netbeans開發一個jsf web應用程序。h:inputText -Field是否可見?
<fieldset>
<div>
<h:inputText id="firstname" value="#{loginCtrl.customer.name}" label="Name">
<f:validateLength minimum="3" maximum="8"/>
</h:inputText>
<div>
...
我寫了代碼,但是當我將它部署到apache tomcat服務器時,沒有顯示字段?爲什麼? h:輸入沒有可見性元素?
問候,並提前THX
PS:我的web.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<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>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/register.jsf</welcome-file>
</welcome-file-list>
</web-app>
好吧我做了所有的重命名和我的輸出已經改變:我沒有得到該網站,但我在瀏覽器窗口中打印的代碼?爲什麼? – maximus
您似乎已將實際視圖文件的擴展名從「.xhtml」更改爲「.jsf」。這個不對。您需要保留實際視圖文件.xhtml的擴展名。將'/ faces/*'的''的值更改爲'* .xhtml'。將''更改爲'register.xhtml'。這樣你就不再需要像'/ faces'或'.jsf'這樣的虛擬網址了。 –
BalusC