JSF 2.3.1形式的InputText

时间:2018-07-09 17:48:23

标签: jsf xhtml

我想在JSF 2.3.1(使用J2E)中为表单提供一个输入文本字段,但是页面上什么也没有,只有文本H1 ...

我搜索了其他帖子,他们说,因为别名应为com.sun,但我不知道如何更改它:(

欢迎任何评论:)

编辑:我也看不到h:commandButton

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
        <title>First Project JSF 2.3</title>
    </h:head>
    <h:body>
    	<h1>First Project JSF 2.3 - hello.xhtml</h1>
    	<h:form>
    	   <h:inputText value="#{helloBean.name}" />
    	</h:form>
    </h:body>
</html>

pom.xml文件

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.primagaz</groupId>
  <artifactId>ProjectTest</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  	<dependencies>
        <!-- Servlet provided by tomcat -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- JSF -->
        <!-- https://mvnrepository.com/artifact/org.apache.myfaces.core/myfaces-api -->
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>2.3.1</version>
        </dependency>

        <!-- PrimeFaces -->
        <!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>6.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.jboss.weld.servlet/weld-servlet-core -->
        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet-core</artifactId>
            <version>3.0.4.Final</version>
        </dependency>
        
        <dependency>
    		<groupId>jstl</groupId>
    		<artifactId>jstl</artifactId>
   			<version>1.2</version>
		</dependency>
        
    	<dependency>
      		<groupId>junit</groupId>
      		<artifactId>junit</artifactId>
      		<version>3.8.1</version>
      		<scope>test</scope>
    	</dependency>
  </dependencies>
  
  
</project>

0 个答案:

没有答案
相关问题