且构网

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

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

更新时间:2023-01-07 12:16:14

您需要首先添加 springsecurity.taglib.xml
as这里提到:

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">

参考