且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 JSF 中使用 Spring Security Facelets 标记库

更新时间:2023-01-07 12:03:10

你需要先添加springsecurity.taglib.xml如此处所述:

You will need to add springsecurity.taglib.xml first as mentioned here:

http://docs.spring.io/autorepo/docs/webflow/2.3.x/reference/html/spring-faces.html#spring-faces-security-taglib

并且你应该在你的类路径中有 org.springframework.faces jar 以便使用它.

and you should have the org.springframework.faces jar in your classpath in order to use it.

然后使用如下安全标签:

then use the security tags as follows:

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:sec="http://www.springframework.org/security/tags">

参考