没有为名称定义标签:viewAction [英] no tag was defined for name: viewAction

查看:65
本文介绍了没有为名称定义标签:viewAction的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将JSF 2.2.2合并到现有项目中,我想使用f:viewAction,但是出现以下错误.

I have just incorporated JSF 2.2.2 in my existing project and I want to use f:viewAction but I am getting the following error.

<f:viewAction> Tag Library supports namespace: http://java.sun.com/jsf/core, \
but no tag was defined for name: viewAction

这是我的代码:

<f:metadata>
    <f:viewAction action="#{testBean.doIT}"/>
</f:metadata>

这是我的控制人:

@Named("testBean")
@Scope(ScopeType.VIEW)
public class TestBeanimplements Serializable {
public void doIT(){
  System.out.println("Test Working !!!!!!!!");
    }
}

这是我针对JSF的Maven配置:

Here is my maven configuration for JSF:

<dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-api</artifactId>
    <version>2.2.2</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-impl</artifactId>
    <version>2.2.2</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>javax.servlet.jsp-api</artifactId>
    <version>2.2.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.el</groupId>
    <artifactId>javax.el-api</artifactId>
    <version>2.2.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet.jsp.jstl</groupId>
    <artifactId>jstl-api</artifactId>
    <version>1.2</version>
    <scope>provided</scope>
</dependency>

任何人都可以向我解释为什么我会收到此错误吗?

Could anyone please explain to me why I am getting this error ?

推荐答案

您必须使用新的命名空间:xmlns:f="http://xmlns.jcp.org/jsf/core"

You have to use the new namespace: xmlns:f="http://xmlns.jcp.org/jsf/core"

这篇关于没有为名称定义标签:viewAction的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆