maven - JSF Base64 错误?

标签 maven jsf tomcat jsf-2 base64

我正在使用 JSF(使用 Maven、Eclipse 和 Tomcat 7)构建一个页面。使用 JSF 进行开发对我来说是新的,但是对于一个大学项目,我们必须使用 JSF。我阅读了很多关于 JSF 入门的教程,我可以自己解决很多问题。

现在我收到一个由 MyFaces 生成的错误。它说:

An Error Occurred:
org/apache/commons/codec/binary/Base64

viewId=/eingabe.xhtml
location=/Users/USERNAME/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/NewProject/index.xhtml
phaseId=RENDER_RESPONSE(6)

Caused by:
java.lang.ClassNotFoundException - org.apache.commons.codec.binary.Base64
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)

index.html:

<?xml version="1.0" encoding="UTF-8"?>
<!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:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html">
<head>
    <title>Index</title>
</head>
<body>

    <h:form>
        <h:outputLabel value="Name:"  for="name"></h:outputLabel>
        <h:inputText id="name" value="#{customer.name}"></h:inputText>
        <h:commandButton id="save" action="#{customer.save}" value="Save"></h:commandButton>
    </h:form>

</body>
</html>

错误是由 MyFaces 而不是 Apache 产生的。我不知道我必须寻找什么以及错误来自何处......

最佳答案

看来你的应用依赖Apache Commons Codec .

您需要获取jar文件并将其添加到WEB-INF/lib。

关于maven - JSF Base64 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23886401/

相关文章:

java - 通过 Maven Tomcat 插件运行时,Hibernate 不解析映射文件

java - -Xlint :all and maven 有问题

java - 在 Spring Boot 中找不到符号(所有构造函数、getter 和 setter)

用于游戏开发/ Assets 管道的 Maven

java - 将 commandLink 嵌套到输出格式

authentication - Tomcat 6.x JDBC 领域,驱动程序问题的类路径

JSF 数据表 : conditional filter facets

jsf - JSESSIONID cookie 何时添加到响应中

java - Tomcat 在部署 WebSocket 应用程序后逐渐耗尽内存

tomcat - 更新对 Tomcat 启动的 war