PrimeFaces: Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
 
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 34: Zeile 34:
   </repository>
   </repository>
</repositories>
</repositories>
</pre>
== Icons Font Awesome ==
=== pom.xml ===
<pre>
<properties>
  ...
  <font-awesome-version>5.6.3</font-awesome-version>
  ...
</properties>
...
<dependencies>
  ...
  <dependency>
    <groupId>org.webjars</groupId>
    <artifactId>font-awesome</artifactId>
    <version>${font-awesome-version}</version>
  </dependency>
  ...
</dependencies>
</pre>
=== *.xhtml - File ===
<pre>
<h:head>
  <h:outputStylesheet library="webjars" name="font-awesome/5.6.3/css/fontawesome.min-jsf.css" />
</h:head>
</pre>
=== WebApplicationInitializer ===
<pre>
public class MainWebAppInitializer implements WebApplicationInitializer  {
  @Override
  public void onStartup(ServletContext sc) throws ServletException {
    ...
    sc.setInitParameter("primefaces.FONT_AWESOME", "true");
    ...
  }
}
</pre>
</pre>



Aktuelle Version vom 18. Januar 2019, 14:36 Uhr

Maven Dependencies

<properties>
  <aristo-version>1.0.1</aristo-version>
  <primefaces-version>6.2.RC2</primefaces-version>
</properties>

...

<dependencies>
  ...
  <dependency>
    <groupId>org.primefaces.themes</groupId>
    <artifactId>aristo</artifactId>
    <version>${aristo-version}</version>
  </dependency>
  <dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>${primefaces-version}</version>
  </dependency>
  ...
</dependencies>

...

<repositories>
  <repository>
  <id>prime-repo</id>
  <name>PrimeFaces Maven Repository</name>
  <url>http://repository.primefaces.org</url>
  <layout>default</layout>
  </repository>
</repositories>

Icons Font Awesome

pom.xml

<properties>
  ...
  <font-awesome-version>5.6.3</font-awesome-version>
  ...
</properties>

...

<dependencies>
  ...
  <dependency>
    <groupId>org.webjars</groupId>
    <artifactId>font-awesome</artifactId>
    <version>${font-awesome-version}</version>
  </dependency>	
  ...
</dependencies>

*.xhtml - File

<h:head>
  <h:outputStylesheet library="webjars" name="font-awesome/5.6.3/css/fontawesome.min-jsf.css" />
</h:head>

WebApplicationInitializer

public class MainWebAppInitializer implements WebApplicationInitializer  {
  @Override
  public void onStartup(ServletContext sc) throws ServletException {
    ...
    sc.setInitParameter("primefaces.FONT_AWESOME", "true");
    ...
  }
}

Links

https://www.mkyong.com/jsf2/primefaces/primefaces-hello-world-example/


Zurück zu Java