PrimeFaces条码样本

Hon*_*dus 3 jsf barcode primefaces

我只是尝试从PrimeFaces Showcase中复制粘贴条形码的样本.这是这段代码,我得到:

在此输入图像描述

我只是想测试它去获得与样本相同的效果.

<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:pm="http://primefaces.org/mobile"
  xmlns:p="http://primefaces.org/ui">  


<h:head> 
</h:head>  

<h:body>
    <p:panelGrid columns="2">

        <h:outputText value="Postnet" />
        <p:barcode value="0123456789" type="postnet"/>

        <h:outputText value="QR" />
        <p:barcode value="0123456789" type="qr"/>
    </p:panelGrid>
</h:body>  
Run Code Online (Sandbox Code Playgroud)

wit*_*arn 6

您是否已将barcode4j和qrgen库添加到依赖项中?

<dependency>
    <groupId>net.glxn</groupId>
    <artifactId>qrgen</artifactId>
    <version>1.4</version>
</dependency>
<dependency>
    <groupId>net.sf.barcode4j</groupId>
    <artifactId>barcode4j-light</artifactId>
    <version>2.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

**maven中央存储库中不存在barcode4j 2.1,因此maven用户需要手动安装